diff --git a/glareclient/osc/v1/artifacts.py b/glareclient/osc/v1/artifacts.py index 667a75d..2fe1c22 100644 --- a/glareclient/osc/v1/artifacts.py +++ b/glareclient/osc/v1/artifacts.py @@ -54,26 +54,28 @@ class ListArtifacts(command.Lister): help='Name of artifact type.', ) parser.add_argument( - '--limit', + '--limit', '-l', default=20, metavar='', + type=int, help='Maximum number of artifacts to get.', ) parser.add_argument( - '--page-size', + '--page-size', '-p', default=20, metavar='', + type=int, help='Number of artifacts to request in each paginated request.', ) parser.add_argument( - '--filter', + '--filter', '-F', default=[], action='append', metavar='', help='Filtering artifact list by a user-defined property.', ) parser.add_argument( - '--sort', + '--sort', '-s', default='name:asc', metavar='[:]', help='Comma-separated list of sort keys and directions in the ' @@ -149,13 +151,13 @@ class CreateArtifact(command.Lister): help='Name of the artifact.', ), parser.add_argument( - '--artifact-version', + '--artifact-version', '-v', default='0.0.0', metavar='', help='Version of the artifact.', ) parser.add_argument( - '--property', + '--property', '-p', metavar='', action='append', default=[], @@ -196,19 +198,19 @@ class UpdateArtifact(command.Lister): help='ID of the artifact to update.', ) parser.add_argument( - '--name', + '--name', '-n', metavar='', help='Name of the artifact.', ), parser.add_argument( - '--remove-property', + '--remove-property', '-r', metavar='', action='append', default=[], help='Property that will be removed.' ) parser.add_argument( - '--property', + '--property', '-p', metavar='', action='append', default=[], diff --git a/glareclient/osc/v1/blobs.py b/glareclient/osc/v1/blobs.py index 73d42f5..4639416 100644 --- a/glareclient/osc/v1/blobs.py +++ b/glareclient/osc/v1/blobs.py @@ -58,7 +58,7 @@ class UploadBlob(command.ShowOne): help='Local file that contains data to be uploaded.', ) parser.add_argument( - '--blob-property', + '--blob-property', '-p', metavar='', help='Name of the blob field.' ) @@ -70,6 +70,7 @@ class UploadBlob(command.ShowOne): ) parser.add_argument( '--progress', + action='store_true', help='Show download progress bar.' ) return parser @@ -119,7 +120,7 @@ class DownloadBlob(command.Command): ) parser.add_argument( '--progress', - default=False, + action='store_true', help='Show download progress bar.' ) parser.add_argument( @@ -130,7 +131,7 @@ class DownloadBlob(command.Command): 'the blob will not be saved.' ) parser.add_argument( - '--blob-property', + '--blob-property', '-p', metavar='', default=None, help='Name of the blob field.' diff --git a/glareclient/tests/unit/osc/v1/test_artifacts.py b/glareclient/tests/unit/osc/v1/test_artifacts.py index 1c4baad..6aa1aa8 100644 --- a/glareclient/tests/unit/osc/v1/test_artifacts.py +++ b/glareclient/tests/unit/osc/v1/test_artifacts.py @@ -82,8 +82,8 @@ class TestListArtifacts(TestArtifacts): self.check_parser(self.cmd, arglist, verify) def test_artifact_list_with_sort(self): - arglist = ['images', '--sort', 'name:asc'] - verify = [('type_name', 'images'), + arglist = ['sample_artifact', '--sort', 'name:asc'] + verify = [('type_name', 'sample_artifact'), ('sort', 'name:asc')] self.check_parser(self.cmd, arglist, verify) @@ -99,19 +99,19 @@ class TestListArtifacts(TestArtifacts): def test_artifact_list_page_size(self): arglist = ['images', '--page-size', '1'] verify = [('type_name', 'images'), - ('page_size', '1')] + ('page_size', 1)] self.check_parser(self.cmd, arglist, verify) def test_artifact_list_limit(self): arglist = ['images', '--limit', '2'] verify = [('type_name', 'images'), - ('limit', '2')] + ('limit', 2)] self.check_parser(self.cmd, arglist, verify) def test_artifact_list_multilimit(self): arglist = ['images', '--limit', '2', '--limit', '1'] verify = [('type_name', 'images'), - ('limit', '1')] + ('limit', 1)] self.check_parser(self.cmd, arglist, verify) diff --git a/glareclient/tests/unit/osc/v1/test_blob.py b/glareclient/tests/unit/osc/v1/test_blob.py index c66f7f6..3bc9b2a 100644 --- a/glareclient/tests/unit/osc/v1/test_blob.py +++ b/glareclient/tests/unit/osc/v1/test_blob.py @@ -231,7 +231,7 @@ class TestDownloadBlob(TestBlobs): arglist = ['images', 'fc15c365-d4f9-4b8b-a090-d9e230f1f6ba', '--file', '/path/to/file', - '--progress', 'True'] + '--progress'] verify = [('type_name', 'images')] parsed_args = self.check_parser(self.cmd, arglist, verify)