Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion salt/srv/salt/base/calamari-crush-location.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ def get_last_crush_location(cluster, osd_id):

errors = []
key = 'daemon-private/osd.%s/v1/calamari/osd_crush_location' % osd_id
osd_keyring = '/var/lib/ceph/osd/%(cluster)s-%(osd_id)s/keyring' % {'cluster': cluster, 'osd_id': osd_id}
temp = "ceph-conf --name osd.N --show-config-value \'keyring\'"
process = subprocess.Popen(temp.split(), stdout=subprocess.PIPE)
osd_keyring = process.communicate()[0]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@theaverageguy Would you please fall back to the default if this Popen returns non-zero?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure just give me a minute! :)

admin_keyring = '/etc/ceph/%s.client.admin.keyring' % cluster
commands = (['ceph', '--cluster', cluster, '--name', 'osd.%s' % osd_id, '--keyring', osd_keyring, 'config-key', 'get', key],
['sudo', 'ceph', '--cluster', cluster, '--keyring', admin_keyring, 'config-key', 'get', key],
Expand Down