Merge "Remove the resource traits parameter of flavor command"

This commit is contained in:
Jenkins 2017-09-13 05:59:13 +00:00 committed by Gerrit Code Review
commit 6bd620a102
4 changed files with 1 additions and 19 deletions

View File

@ -68,13 +68,6 @@ class CreateFlavor(command.ShowOne):
help=_("Resources to add to this flavor "
"(repeat option to set multiple resources)")
)
parser.add_argument(
"--resource-traits",
metavar="<key=value>",
action=parseractions.KeyValueAction,
help=_("Resource traits to add to this flavor "
"(repeat option to set multiple resource traits)")
)
return parser
def take_action(self, parsed_args):
@ -91,7 +84,6 @@ class CreateFlavor(command.ShowOne):
name=parsed_args.name,
description=parsed_args.description,
resources=parsed_args.resources,
resource_traits=parsed_args.resource_traits,
is_public=is_public,
disabled=parsed_args.disabled,
)
@ -148,7 +140,6 @@ class ListFlavor(command.Lister):
"Is Public",
"Description",
"Resources",
"Resource Traits",
)
columns = (
"UUID",
@ -156,7 +147,6 @@ class ListFlavor(command.Lister):
"Is Public",
"Description",
"Resources",
"Resource Traits",
)
return (column_headers,

View File

@ -182,7 +182,6 @@ class FakeFlavor(object):
"created_at": "2016-09-27T02:37:21.966342+00:00",
"description": "fake_description",
"resources": {"BAREMETAL_GOLD": 1},
"resource_traits": {"BAREMETAL_GOLD": "FPGA"},
"is_public": False,
"disabled": False,
"name": "flavor-name-" + uuidutils.generate_uuid(dashed=False),

View File

@ -34,7 +34,6 @@ class TestFlavor(test_base.TestBaremetalComputeV1):
'disabled',
'is_public',
'name',
'resource_traits',
'resources',
'updated_at',
'uuid',
@ -46,7 +45,6 @@ class TestFlavor(test_base.TestBaremetalComputeV1):
fake_flavor.disabled,
fake_flavor.is_public,
fake_flavor.name,
fake_flavor.resource_traits,
fake_flavor.resources,
fake_flavor.updated_at,
fake_flavor.uuid,
@ -226,7 +224,6 @@ class TestFlavorList(TestFlavor):
"Is Public",
"Description",
"Resources",
"Resource Traits",
)
list_data = ((
@ -235,7 +232,6 @@ class TestFlavorList(TestFlavor):
TestFlavor.fake_flavor.is_public,
TestFlavor.fake_flavor.description,
TestFlavor.fake_flavor.resources,
TestFlavor.fake_flavor.resource_traits,
),)
def setUp(self):

View File

@ -23,8 +23,7 @@ class Flavor(base.Resource):
class FlavorManager(base.ManagerWithFind):
resource_class = Flavor
def create(self, name, resources, resource_traits, is_public, disabled,
description=None):
def create(self, name, resources, is_public, disabled, description=None):
url = '/flavors'
data = {
'name': name,
@ -34,8 +33,6 @@ class FlavorManager(base.ManagerWithFind):
}
if resources:
data['resources'] = resources
if resource_traits:
data['resource_traits'] = resource_traits
return self._create(url, data=data)
def delete(self, flavor):