Remove the resource traits parameter of flavor command
Because we cannot support the resource traits in Mogan for now. Change-Id: Idab59e6c4723ff0ae3a4f2470e38b4164ed29b51
This commit is contained in:
parent
ac4c5d35e3
commit
ffca8e91cd
@ -68,13 +68,6 @@ class CreateFlavor(command.ShowOne):
|
|||||||
help=_("Resources to add to this flavor "
|
help=_("Resources to add to this flavor "
|
||||||
"(repeat option to set multiple resources)")
|
"(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
|
return parser
|
||||||
|
|
||||||
def take_action(self, parsed_args):
|
def take_action(self, parsed_args):
|
||||||
@ -91,7 +84,6 @@ class CreateFlavor(command.ShowOne):
|
|||||||
name=parsed_args.name,
|
name=parsed_args.name,
|
||||||
description=parsed_args.description,
|
description=parsed_args.description,
|
||||||
resources=parsed_args.resources,
|
resources=parsed_args.resources,
|
||||||
resource_traits=parsed_args.resource_traits,
|
|
||||||
is_public=is_public,
|
is_public=is_public,
|
||||||
disabled=parsed_args.disabled,
|
disabled=parsed_args.disabled,
|
||||||
)
|
)
|
||||||
@ -148,7 +140,6 @@ class ListFlavor(command.Lister):
|
|||||||
"Is Public",
|
"Is Public",
|
||||||
"Description",
|
"Description",
|
||||||
"Resources",
|
"Resources",
|
||||||
"Resource Traits",
|
|
||||||
)
|
)
|
||||||
columns = (
|
columns = (
|
||||||
"UUID",
|
"UUID",
|
||||||
@ -156,7 +147,6 @@ class ListFlavor(command.Lister):
|
|||||||
"Is Public",
|
"Is Public",
|
||||||
"Description",
|
"Description",
|
||||||
"Resources",
|
"Resources",
|
||||||
"Resource Traits",
|
|
||||||
)
|
)
|
||||||
|
|
||||||
return (column_headers,
|
return (column_headers,
|
||||||
|
@ -182,7 +182,6 @@ class FakeFlavor(object):
|
|||||||
"created_at": "2016-09-27T02:37:21.966342+00:00",
|
"created_at": "2016-09-27T02:37:21.966342+00:00",
|
||||||
"description": "fake_description",
|
"description": "fake_description",
|
||||||
"resources": {"BAREMETAL_GOLD": 1},
|
"resources": {"BAREMETAL_GOLD": 1},
|
||||||
"resource_traits": {"BAREMETAL_GOLD": "FPGA"},
|
|
||||||
"is_public": False,
|
"is_public": False,
|
||||||
"disabled": False,
|
"disabled": False,
|
||||||
"name": "flavor-name-" + uuidutils.generate_uuid(dashed=False),
|
"name": "flavor-name-" + uuidutils.generate_uuid(dashed=False),
|
||||||
|
@ -34,7 +34,6 @@ class TestFlavor(test_base.TestBaremetalComputeV1):
|
|||||||
'disabled',
|
'disabled',
|
||||||
'is_public',
|
'is_public',
|
||||||
'name',
|
'name',
|
||||||
'resource_traits',
|
|
||||||
'resources',
|
'resources',
|
||||||
'updated_at',
|
'updated_at',
|
||||||
'uuid',
|
'uuid',
|
||||||
@ -46,7 +45,6 @@ class TestFlavor(test_base.TestBaremetalComputeV1):
|
|||||||
fake_flavor.disabled,
|
fake_flavor.disabled,
|
||||||
fake_flavor.is_public,
|
fake_flavor.is_public,
|
||||||
fake_flavor.name,
|
fake_flavor.name,
|
||||||
fake_flavor.resource_traits,
|
|
||||||
fake_flavor.resources,
|
fake_flavor.resources,
|
||||||
fake_flavor.updated_at,
|
fake_flavor.updated_at,
|
||||||
fake_flavor.uuid,
|
fake_flavor.uuid,
|
||||||
@ -226,7 +224,6 @@ class TestFlavorList(TestFlavor):
|
|||||||
"Is Public",
|
"Is Public",
|
||||||
"Description",
|
"Description",
|
||||||
"Resources",
|
"Resources",
|
||||||
"Resource Traits",
|
|
||||||
)
|
)
|
||||||
|
|
||||||
list_data = ((
|
list_data = ((
|
||||||
@ -235,7 +232,6 @@ class TestFlavorList(TestFlavor):
|
|||||||
TestFlavor.fake_flavor.is_public,
|
TestFlavor.fake_flavor.is_public,
|
||||||
TestFlavor.fake_flavor.description,
|
TestFlavor.fake_flavor.description,
|
||||||
TestFlavor.fake_flavor.resources,
|
TestFlavor.fake_flavor.resources,
|
||||||
TestFlavor.fake_flavor.resource_traits,
|
|
||||||
),)
|
),)
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
@ -23,8 +23,7 @@ class Flavor(base.Resource):
|
|||||||
class FlavorManager(base.ManagerWithFind):
|
class FlavorManager(base.ManagerWithFind):
|
||||||
resource_class = Flavor
|
resource_class = Flavor
|
||||||
|
|
||||||
def create(self, name, resources, resource_traits, is_public, disabled,
|
def create(self, name, resources, is_public, disabled, description=None):
|
||||||
description=None):
|
|
||||||
url = '/flavors'
|
url = '/flavors'
|
||||||
data = {
|
data = {
|
||||||
'name': name,
|
'name': name,
|
||||||
@ -34,8 +33,6 @@ class FlavorManager(base.ManagerWithFind):
|
|||||||
}
|
}
|
||||||
if resources:
|
if resources:
|
||||||
data['resources'] = resources
|
data['resources'] = resources
|
||||||
if resource_traits:
|
|
||||||
data['resource_traits'] = resource_traits
|
|
||||||
return self._create(url, data=data)
|
return self._create(url, data=data)
|
||||||
|
|
||||||
def delete(self, flavor):
|
def delete(self, flavor):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user