Add newline at end of file when writing keyring

Change-Id: If79977c2ec7588b09ca2e118141c7f3d9cf61767
Closes-Bug: #1864706
This commit is contained in:
Frode Nordahl 2020-02-26 11:27:35 +01:00
parent c5a7e8f1c8
commit 6a00cf92e1
No known key found for this signature in database
GPG Key ID: 6A5D59A3BA48373F
2 changed files with 3 additions and 1 deletions

View File

@ -1372,6 +1372,8 @@ def create_keyrings():
if not output:
# NOTE: key not yet created, raise exception and retry
raise Exception
# NOTE: octopus wants newline at end of file LP: #1864706
output += '\n'
write_file(_client_admin_keyring, output,
owner=ceph_user(), group=ceph_user(),
perms=0o400)

View File

@ -833,7 +833,7 @@ class CephTestCase(unittest.TestCase):
])
mock_write_file.assert_called_with(
'/etc/ceph/ceph.client.admin.keyring',
'testkey', group='ceph', owner='ceph',
'testkey\n', group='ceph', owner='ceph',
perms=0o400
)
else: