Skip osd-devices not absolute paths
This change skips over any devices which does not start with a leading
folder separator ('/'). Allowing such entries causes an OSD to be
created out of the charm directory. This can be caused by something as
innocuous as 2 spaces between devices. The result is that the root
device is also running an OSD, which is undesirable.
Change-Id: I0b5530dc4ec4306a9efedb090e583fb4e2089749
Closes-Bug: 1652175
This commit is contained in:
@@ -59,9 +59,13 @@ def add_device(request, device_path, bucket=None):
|
||||
|
||||
|
||||
def get_devices():
|
||||
return [
|
||||
os.path.realpath(path)
|
||||
for path in action_get('osd-devices').split(' ')]
|
||||
devices = []
|
||||
for path in action_get('osd-devices').split(' '):
|
||||
path = path.strip()
|
||||
if os.path.isabs(path):
|
||||
devices.append(path)
|
||||
|
||||
return devices
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user