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:
cheng 2017-03-18 03:43:32 +00:00
parent 5c0814daa6
commit 99412d4830
2 changed files with 2 additions and 2 deletions

View File

@ -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:

View File

@ -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: