Remove Deprecated Features in Ranger

As of Stein, injected_files, injected_file_content_bytes,
and injected_path_content_bytes have been deprecated.
This patchset removes those variables.

Change-Id: I0a7fa6860a8f5573ae2435c3740c7fb4ec4bb54e
This commit is contained in:
jh629g 2019-11-25 12:16:00 -06:00
parent b78d9f0f81
commit 36ebd47daa
11 changed files with 33 additions and 73 deletions

View File

@ -423,10 +423,10 @@ class DataManager(object):
@classmethod
def get_dict_from_quota(cls, quota, quota_type):
types = {
'compute': ['instances', 'injected_files', 'key_pairs', 'ram',
'compute': ['instances', 'key_pairs', 'ram',
'vcpus', 'metadata_items',
'injected_file_content_bytes', 'floating_ips',
'fixed_ips', 'injected_file_path_bytes',
'floating_ips',
'fixed_ips',
'server_groups', 'server_group_members'
],
'storage': ['gigabytes', 'snapshots', 'volumes'],

View File

@ -26,38 +26,31 @@ class Compute(Model):
"""
instances = wsme.wsattr(wsme.types.text, mandatory=True)
injected_files = wsme.wsattr(wsme.types.text, mandatory=True, name="injected-files")
key_pairs = wsme.wsattr(wsme.types.text, mandatory=True, name="key-pairs")
ram = wsme.wsattr(wsme.types.text, mandatory=True)
vcpus = wsme.wsattr(wsme.types.text, mandatory=False)
metadata_items = wsme.wsattr(wsme.types.text, mandatory=False, name="metadata-items")
injected_file_content_bytes = wsme.wsattr(wsme.types.text, mandatory=False, name="injected-file-content-bytes")
floating_ips = wsme.wsattr(wsme.types.text, mandatory=False, name="floating-ips")
fixed_ips = wsme.wsattr(wsme.types.text, mandatory=False, name="fixed-ips")
injected_file_path_bytes = wsme.wsattr(wsme.types.text, mandatory=False, name="injected-file-path-bytes")
server_groups = wsme.wsattr(wsme.types.text, mandatory=False, name="server-groups")
server_group_members = wsme.wsattr(wsme.types.text, mandatory=False, name="server-group-members")
def __init__(self, instances='', injected_files='', key_pairs='', ram='',
vcpus=None, metadata_items=None, injected_file_content_bytes=None,
floating_ips='', fixed_ips='', injected_file_path_bytes='',
def __init__(self, instances='', key_pairs='', ram='',
vcpus=None, metadata_items=None,
floating_ips='', fixed_ips='',
server_groups='', server_group_members=''):
"""Create a new compute instance.
:param instances:
:param injected_files:
:param key_pairs:
:param ram:
:param vcpus:
:param metadata_items:
:param injected_file_content_bytes:
:param floating_ips:
:param fixed_ips:
:param injected_file_path_bytes:
:param server_groups:
:param server_group_members:
"""
self.instances = instances
self.injected_files = injected_files
self.key_pairs = key_pairs
self.ram = ram
if vcpus is None:
@ -69,15 +62,9 @@ class Compute(Model):
conf.quotas_default_values.compute.metadata_items
else:
self.metadata_items = metadata_items
if injected_file_content_bytes is None:
self.injected_file_content_bytes = \
conf.quotas_default_values.compute.injected_file_content_bytes
else:
self.injected_file_content_bytes = injected_file_content_bytes
self.floating_ips = floating_ips
self.fixed_ips = fixed_ips
self.injected_file_path_bytes = injected_file_path_bytes
self.server_groups = server_groups
self.server_group_members = server_group_members

View File

@ -29,8 +29,7 @@ logging = config.get_log_config(config.cms['log'], server['name'], app_module)
quotas_default_values = {
'compute': {
'vcpus': '20',
'metadata_items': '128',
'injected_file_content_bytes': '10240'
'metadata_items': '128'
},
'network': {
'security_groups': '10',

View File

@ -820,14 +820,11 @@ definitions:
type: object
required:
- instances
- injected_files
- key_pairs
- ram
properties:
instances:
type: string
injected_files:
type: string
key_pairs:
type: string
ram:
@ -836,14 +833,10 @@ definitions:
type: string
metadata_items:
type: string
injected_file_content_bytes:
type: string
floating_ips:
type: string
fixed_ips:
type: string
injected_file_path_bytes:
type: string
server_groups:
type: string
server_group_members:

View File

@ -58,8 +58,7 @@ logging = {
quotas_default_values = {
'compute': {
'vcpus': '20',
'metadata_items': '128',
'injected_file_content_bytes': '10240'
'metadata_items': '128'
},
'network': {
'security_groups': '10',

View File

@ -326,7 +326,6 @@ CUSTOMER_JSON = {
"compute": [
{
"instances": "10",
"injected-files": "10",
"key-pairs": "10",
"ram": "10"
}
@ -358,7 +357,6 @@ CUSTOMER_JSON = {
"compute": [
{
"instances": "10",
"injected-files": "10",
"key-pairs": "10",
"ram": "10"
}
@ -403,7 +401,6 @@ CUSTOMER_JSON = {
"compute": [
{
"instances": "10",
"injected-files": "10",
"key-pairs": "10",
"ram": "10"
}
@ -437,9 +434,9 @@ RET_CUSTOMER_JSON = {
"ocx_cust": "123456889"
},
"regions": [Models.Region(**{"name": "SAN1", "type": "single", "quotas": [Models.Quota(**{
"compute": [Models.Compute(instances='1', injected_files='1', key_pairs='1', ram='1',
vcpus='1', metadata_items='1', injected_file_content_bytes='1',
floating_ips='1', fixed_ips='1', injected_file_path_bytes='1',
"compute": [Models.Compute(instances='1', key_pairs='1', ram='1',
vcpus='1', metadata_items='1',
floating_ips='1', fixed_ips='1',
server_groups='1', server_group_members='1')],
"storage": [Models.Storage(gigabytes='1', snapshots='1', volumes='1')],
"network": [Models.Network(floating_ips='1', networks='1', ports='1', routers='1', subnets='1',
@ -451,9 +448,9 @@ RET_CUSTOMER_JSON = {
{"id": "userId1", "role": ["admin", "other"]})
],
"defaultQuotas": [Models.Quota(**{
"compute": [Models.Compute(instances='1', injected_files='1', key_pairs='1', ram='1',
vcpus='1', metadata_items='1', injected_file_content_bytes='1',
floating_ips='1', fixed_ips='1', injected_file_path_bytes='1',
"compute": [Models.Compute(instances='1', key_pairs='1', ram='1',
vcpus='1', metadata_items='1',
floating_ips='1', fixed_ips='1',
server_groups='1', server_group_members='1')],
"storage": [Models.Storage(gigabytes='1', snapshots='1', volumes='1')],
"network": [Models.Network(floating_ips='1', networks='1', ports='1', routers='1', subnets='1',

View File

@ -215,7 +215,6 @@ REGION_JSON = [
"compute": [
{
"instances": "10",
"injected-files": "10",
"key-pairs": "10",
"ram": "10"
}

View File

@ -15,7 +15,6 @@
"compute": [
{
"instances": "10",
"injected-files": "10",
"keypairs": "10",
"ram": "10"
}
@ -47,7 +46,6 @@
"compute": [
{
"instances": "10",
"injected-files": "10",
"keypairs": "10",
"ram": "10"
}
@ -92,7 +90,6 @@
"compute": [
{
"instances": "10",
"injected-files": "10",
"keypairs": "10",
"ram": "10"
}

View File

@ -120,7 +120,7 @@ good_data = {
"n\": {\n \"name\": \"regionnamezzzz\",\n \"quota"
"s\":[\n {\n \"compute\": \n "
" {\n \"instances\": \"10\",\n "
"\"injected_files\": \"10\",\n \"keypair"
"\"keypair"
"s\": \"10\",\n \"ram\": \"10\"\n "
" },\n \"storage\":\n {\n "
" \"gigabytes\": \"10\",\n \"snapsho"
@ -138,8 +138,8 @@ good_data = {
"}\n ]\n },\n \"regions\": [\n {\n \"nam"
"e\": \"regionname\",\n \"quotas\":[\n {\n "
" \"compute\": \n {\n \"ins"
"tances\": \"10\",\n \"injected_file"
"s\": \"10\",\n \"keypairs\": \"10\",\n "
"tances\": \"10\","
"\n \"keypairs\": \"10\",\n "
" \"ram\": \"10\"\n },\n \"st"
"orage\":\n {\n \"gigabyte"
"s\": \"10\",\n \"snapshots\": \"10\",\n "
@ -156,7 +156,7 @@ good_data = {
" }\n ]\n },\n\t{\n \"name\": \"regionname"
"test\",\n \"quotas\":[\n {\n \"com"
"pute\": \n {\n \"instanc"
"es\": \"10\",\n \"injected_files\": \"10\",\n"
"es\": \"10\",\n"
" \"keypairs\": \"10\",\n \"ra"
"m\": \"10\"\n },\n \"storage\":\n "
" {\n \"gigabytes\": \"10\",\n "

View File

@ -296,8 +296,7 @@ jsondata = {
"compute": {
"instances": "10",
"ram": "10",
"keypairs": "10",
"injected_files": "10"
"keypairs": "10"
},
"storage": {"gigabytes": "10",
"snapshots": "10",
@ -365,8 +364,7 @@ jsondata = {
{
"instances": "10",
"ram": "10",
"keypairs": "10",
"injected_files": "10"
"keypairs": "10"
},
"storage":
{
@ -460,8 +458,7 @@ json_data = {
"compute": {
"instances": "111",
"ram": "111",
"keypairs": "111",
"injected_files": "111"
"keypairs": "111"
},
"network": {
"port": "111",
@ -510,8 +507,7 @@ json_data = {
"compute": {
"instances": "10",
"ram": "10",
"keypairs": "10",
"injected_files": "10"
"keypairs": "10"
},
"network": {
"port": "10",
@ -544,7 +540,7 @@ targets = [{'users': [{'id': 'userId1', 'roles': ['admin', 'other']},
'quotas': [{'storage': {'gigabytes': '10', 'volumes': '10',
'snapshots': '10'},
'compute': {'instances': '10', 'ram': '10',
'keypairs': '10', 'injected_files': '10'},
'keypairs': '10'},
'network': {'port': '10',
'router': '10',
'subnet': '10',
@ -628,8 +624,7 @@ input_data_resource = {'resource_id': '1e24981a-fa51-11e5-86aa-5e5517507c66',
'compute': {
'instances': '10',
'ram': '10',
'keypairs': '10',
'injected_files': '10'},
'keypairs': '10'},
'network': {
'subnet': '10',
'router': '10',
@ -649,8 +644,7 @@ input_data_resource = {'resource_id': '1e24981a-fa51-11e5-86aa-5e5517507c66',
'compute': {
'instances': '10',
'ram': '10',
'keypairs': '10',
'injected_files': '10'},
'keypairs': '10'},
'network': {
'subnet': '10',
'router': '10',
@ -679,8 +673,7 @@ input_data_resource = {'resource_id': '1e24981a-fa51-11e5-86aa-5e5517507c66',
'snapshots': '10'},
'compute': {'instances': '10',
'ram': '10',
'keypairs': '10',
'injected_files': '10'},
'keypairs': '10'},
'network': {'subnet': '10',
'router': '10',
'port': '10',

View File

@ -18,8 +18,7 @@ alldata = {
'snapshots': '111'},
'compute': {'instances': '111',
'ram': '111',
'keypairs': '111',
'injected_files': '111'},
'keypairs': '111'},
'network': {'port': '111',
'router': '111',
'subnet': '111',
@ -34,8 +33,7 @@ alldata = {
'volumes': '10',
'snapshots': '10'},
'compute': {'instances': '10', 'ram': '10',
'keypairs': '10',
'injected_files': '10'},
'keypairs': '10'},
'network': {'port': '10', 'router': '10',
'subnet': '10', 'network': '10',
'floatingip': '10'}}]}],
@ -48,8 +46,7 @@ region_quotas = {'users':
'quotas': [{'storage': {'gigabytes': '10',
'volumes': '10', 'snapshots': '10'},
'compute': {'instances': '10', 'ram': '10',
'keypairs': '10',
'injected_files': '10'},
'keypairs': '10'},
'network': {'port': '10',
'router': '10',
'subnet': '10',
@ -71,8 +68,7 @@ full_region = {'users': [{'id': 'userId1', 'roles': ['admin', 'other']},
'quotas': [{'storage': {'gigabytes': '10',
'volumes': '10', 'snapshots': '10'},
'compute': {'instances': '10', 'ram': '10',
'keypairs': '10',
'injected_files': '10'},
'keypairs': '10'},
'network': {'port': '10', 'router': '10',
'subnet': '10',
'network': '10', 'floatingip': '10'}}]}
@ -138,7 +134,7 @@ full_yaml_default_quotas = 'heat_template_version: 2015-1-1\n\ndescription: yaml
' \n neutron_quota:\n properties:\n floatingip: 111\n' \
' network: 111\n port: 111\n router: 111\n subnet: 111\n' \
' project: {get_resource: 1e24981a-fa51-11e5-86aa-5e5517507c66}\n type: OS::Neutron::Quota\n\n' \
' \n nova_quota:\n properties:\n injected_files: 111\n ' \
' \n nova_quota:\n properties:\n ' \
'instances: 111\n keypairs: 111\n ram: 111\n ' \
'project: {get_resource: 1e24981a-fa51-11e5-86aa-5e5517507c66}\n ' \
'type: OS::Nova::Quota\n\n \n userId1:\n' \
@ -180,7 +176,7 @@ full_yaml_quotas = 'heat_template_version: 2015-1-1\n\ndescription: yaml file fo
'port: 10\n router: 10\n subnet: 10\n ' \
'project: {get_resource: 1e24981a-fa51-11e5-86aa-5e5517507c66}\n ' \
'type: OS::Neutron::Quota\n\n \n nova_quota:\n ' \
'properties:\n injected_files: 10\n instances: 10\n ' \
'properties:\n instances: 10\n ' \
'keypairs: 10\n ram: 10\n project: {get_resource: 1e24981a-fa51-11e5-86aa-5e5517507c66}\n ' \
'type: OS::Nova::Quota\n\n \n userId1zzzz:\n properties:\n ' \
'groups:\n - {get_resource: 1e24981a-fa51-11e5-86aa-5e5517507c66_userId1zzzz_group}\n ' \
@ -259,7 +255,7 @@ fullyaml_aic4 = \
' floatingip: 111\n network: 111\n port: 111\n router: 111\n'\
' subnet: 111\n project: {get_resource: 1e24981a-fa51-11e5-86aa-5e5517507c66}\n'\
' type: OS::Neutron::Quota\n\n \n nova_quota:\n properties:\n'\
' injected_files: 111\n instances: 111\n keypairs: 111\n'\
' instances: 111\n keypairs: 111\n'\
' ram: 111\n project: {get_resource: 1e24981a-fa51-11e5-86aa-5e5517507c66}\n'\
' type: OS::Nova::Quota\n\n \n userId1:\n properties:\n groups:\n'\
' - {get_resource: 1e24981a-fa51-11e5-86aa-5e5517507c66_userId1_group}\n'\