Skip to content
This repository has been archived by the owner on Jul 18, 2023. It is now read-only.

Commit

Permalink
Merge pull request #41 from BlackSmith/master
Browse files Browse the repository at this point in the history
 Better error messages in snapshot
  • Loading branch information
BlackSmith authored Feb 27, 2018
2 parents ae154d8 + 6687163 commit 1382487
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion 5minute.spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: 5minute
Version: 0.2.27
Version: 0.2.28
Release: 1%{?dist}
Summary: Command line tool for getting instance from OpenStack

Expand Down
12 changes: 8 additions & 4 deletions vminute/vminute.py
Original file line number Diff line number Diff line change
Expand Up @@ -788,9 +788,13 @@ def __parse_params(self, opts, argv):
elif key in ('--metadata', '-m'):
if params['metadata'] is None:
params['metadata'] = {}
for it in val.split(';'):
col, val = it.split('=')
params['metadata'][col] = val.replace(',', ' ')
try:
for it in val.split(';'):
col, val = it.split('=')
params['metadata'][col] = val.replace(',', ' ')
except Exception:
die("The problem with parsing of metadata parameter. "
"Please try 5minute snapshot --help.")
elif key in ('--umount', '-u'):
params['umount'] = True
elif key in ('--volume'):
Expand All @@ -801,7 +805,7 @@ def __parse_params(self, opts, argv):
params['delete'] = True
else:
die("Bad parameter '%s'. Please try 5minute "
"screenshot --help." % key)
"snapshot --help." % key)
if 'delete' in params:
if len(argv) != 1:
die("Name of the snapshot is ambiguous or empty.")
Expand Down

0 comments on commit 1382487

Please sign in to comment.