Merge "Forbid users to create shares with the name "None""

This commit is contained in:
Zuul 2021-02-10 20:07:40 +00:00 committed by Gerrit Code Review
commit f56e451d51
1 changed files with 5 additions and 0 deletions

View File

@ -884,6 +884,11 @@ def do_create(cs, args):
share_network = None
if args.share_network:
share_network = _find_share_network(cs, args.share_network)
if args.name == 'None':
raise exceptions.CommandError(
"Share name cannot be with the value 'None'")
share = cs.shares.create(args.share_protocol, args.size, args.snapshot_id,
args.name, args.description,
metadata=share_metadata,