From 1c49a1f01da73b8eed701809de88b408e738dfed Mon Sep 17 00:00:00 2001 From: Huanxuan Ao Date: Wed, 8 Mar 2017 10:01:16 +0800 Subject: Fix NoneType error for volume snapshot create command In volume snapshot command, is the same as when --volume is not specified, but cannot be None, so when is not specified ( is None), a NoneType error appears. So make no longer optional, it should be always present. Change-Id: I3d9f10753a8ef601e70816421c160598e2cc811f Closes-bug: #1659894 --- openstackclient/volume/v1/volume_snapshot.py | 3 +-- openstackclient/volume/v2/volume_snapshot.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'openstackclient/volume') diff --git a/openstackclient/volume/v1/volume_snapshot.py b/openstackclient/volume/v1/volume_snapshot.py index f22c338b..3e83da5a 100644 --- a/openstackclient/volume/v1/volume_snapshot.py +++ b/openstackclient/volume/v1/volume_snapshot.py @@ -38,8 +38,7 @@ class CreateVolumeSnapshot(command.ShowOne): parser.add_argument( 'snapshot_name', metavar='', - nargs="?", - help=_('Name of the snapshot (default to None)'), + help=_('Name of the new snapshot'), ) parser.add_argument( '--volume', diff --git a/openstackclient/volume/v2/volume_snapshot.py b/openstackclient/volume/v2/volume_snapshot.py index 804c8291..fe969410 100644 --- a/openstackclient/volume/v2/volume_snapshot.py +++ b/openstackclient/volume/v2/volume_snapshot.py @@ -38,8 +38,7 @@ class CreateVolumeSnapshot(command.ShowOne): parser.add_argument( "snapshot_name", metavar="", - nargs="?", - help=_("Name of the new snapshot (default to None)") + help=_("Name of the new snapshot"), ) parser.add_argument( "--volume", -- cgit v1.2.1