fix get ring name
replace ring_name = basename(ring_path)[:len('ring.gz')] with ring_name = basename(ring_path)[:-len('.ring.gz')] Change-Id: I741e46d116c8fc7c2e91a51da4284302eec3aa41 Closes-bug: #1668736
This commit is contained in:
parent
5c0814daa6
commit
99412d4830
@ -59,7 +59,7 @@ if __name__ == '__main__':
|
||||
|
||||
ring = ring_name = None
|
||||
if ring_path:
|
||||
ring_name = basename(ring_path)[:len('ring.gz')]
|
||||
ring_name = basename(ring_path)[:-len('.ring.gz')]
|
||||
ring = Ring(ring_path)
|
||||
|
||||
try:
|
||||
|
@ -49,7 +49,7 @@ def parse_get_node_args(options, args):
|
||||
if options.policy_name:
|
||||
if POLICIES.get_by_name(options.policy_name) is None:
|
||||
raise InfoSystemExit('No policy named %r' % options.policy_name)
|
||||
elif args and args[0].endswith('ring.gz'):
|
||||
elif args and args[0].endswith('.ring.gz'):
|
||||
if os.path.exists(args[0]):
|
||||
ring_path = args.pop(0)
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user