including base_config
- test_os_extra_specs.py fixes unrelated failing test case - tox.ini py34 and pypy not supported at this time Change-Id: If8e26fbee2d16f2160baa749b5b241e49e3e75b8
This commit is contained in:
parent
e575ac52d9
commit
85f0e0f010
@ -2,6 +2,7 @@
|
|||||||
import argparse
|
import argparse
|
||||||
import cli_common
|
import cli_common
|
||||||
import config
|
import config
|
||||||
|
import orm.base_config as base_config
|
||||||
import os
|
import os
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
@ -358,8 +359,8 @@ def get_token(timeout, args, host):
|
|||||||
print message
|
print message
|
||||||
raise cli_common.MissingArgumentError(message)
|
raise cli_common.MissingArgumentError(message)
|
||||||
|
|
||||||
keystone_ep = cli_common.get_keystone_ep('{}:8080'.format(host),
|
keystone_ep = cli_common.get_keystone_ep(
|
||||||
auth_region)
|
'{}:{}'.format(host, base_config.rms['port']), auth_region)
|
||||||
if keystone_ep is None:
|
if keystone_ep is None:
|
||||||
raise ConnectionError(
|
raise ConnectionError(
|
||||||
'Failed in get_token, host: {}, region: {}'.format(host,
|
'Failed in get_token, host: {}, region: {}'.format(host,
|
||||||
@ -386,7 +387,7 @@ def get_token(timeout, args, host):
|
|||||||
|
|
||||||
def get_environment_variable(argument):
|
def get_environment_variable(argument):
|
||||||
# The rules are: all caps, underscores instead of dashes and prefixed
|
# The rules are: all caps, underscores instead of dashes and prefixed
|
||||||
environment_variable = 'AIC_ORM_{}'.format(
|
environment_variable = 'RANGER_{}'.format(
|
||||||
argument.replace('-', '_').upper())
|
argument.replace('-', '_').upper())
|
||||||
|
|
||||||
return os.environ.get(environment_variable)
|
return os.environ.get(environment_variable)
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
import argparse
|
import argparse
|
||||||
import cli_common
|
import cli_common
|
||||||
import config
|
import config
|
||||||
|
import orm.base_config as base_config
|
||||||
import os
|
import os
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
@ -315,8 +316,8 @@ def get_token(timeout, args, host):
|
|||||||
print message
|
print message
|
||||||
raise cli_common.MissingArgumentError(message)
|
raise cli_common.MissingArgumentError(message)
|
||||||
|
|
||||||
keystone_ep = cli_common.get_keystone_ep('{}:8080'.format(host),
|
keystone_ep = cli_common.get_keystone_ep(
|
||||||
auth_region)
|
'{}:{}'.format(host, base_config.rms['port']), auth_region)
|
||||||
if keystone_ep is None:
|
if keystone_ep is None:
|
||||||
raise ConnectionError(
|
raise ConnectionError(
|
||||||
'Failed in get_token, host: {}, region: {}'.format(host,
|
'Failed in get_token, host: {}, region: {}'.format(host,
|
||||||
@ -343,7 +344,7 @@ def get_token(timeout, args, host):
|
|||||||
|
|
||||||
def get_environment_variable(argument):
|
def get_environment_variable(argument):
|
||||||
# The rules are: all caps, underscores instead of dashes and prefixed
|
# The rules are: all caps, underscores instead of dashes and prefixed
|
||||||
environment_variable = 'AIC_ORM_{}'.format(
|
environment_variable = 'RANGER_{}'.format(
|
||||||
argument.replace('-', '_').upper())
|
argument.replace('-', '_').upper())
|
||||||
|
|
||||||
return os.environ.get(environment_variable)
|
return os.environ.get(environment_variable)
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
import argparse
|
import argparse
|
||||||
import config
|
import config
|
||||||
|
import orm.base_config as base_config
|
||||||
import os
|
import os
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
@ -207,8 +208,8 @@ def get_token(timeout, args, host):
|
|||||||
print message
|
print message
|
||||||
raise cli_common.MissingArgumentError(message)
|
raise cli_common.MissingArgumentError(message)
|
||||||
|
|
||||||
keystone_ep = cli_common.get_keystone_ep('{}:8080'.format(host),
|
keystone_ep = cli_common.get_keystone_ep(
|
||||||
auth_region)
|
'{}:{}'.format(host, base_config.rms['port']), auth_region)
|
||||||
if keystone_ep is None:
|
if keystone_ep is None:
|
||||||
raise ConnectionError(
|
raise ConnectionError(
|
||||||
'Failed in get_token, host: {}, region: {}'.format(host,
|
'Failed in get_token, host: {}, region: {}'.format(host,
|
||||||
@ -298,7 +299,7 @@ def cmd_data(args):
|
|||||||
|
|
||||||
def get_environment_variable(argument):
|
def get_environment_variable(argument):
|
||||||
# The rules are: all caps, underscores instead of dashes and prefixed
|
# The rules are: all caps, underscores instead of dashes and prefixed
|
||||||
environment_variable = 'AIC_ORM_{}'.format(
|
environment_variable = 'RANGER_{}'.format(
|
||||||
argument.replace('-', '_').upper())
|
argument.replace('-', '_').upper())
|
||||||
|
|
||||||
return os.environ.get(environment_variable)
|
return os.environ.get(environment_variable)
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
import argparse
|
import argparse
|
||||||
import cli_common
|
import cli_common
|
||||||
import config
|
import config
|
||||||
|
import orm.base_config as base_config
|
||||||
import os
|
import os
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
@ -232,8 +233,8 @@ def get_token(timeout, args, host):
|
|||||||
print message
|
print message
|
||||||
raise cli_common.MissingArgumentError(message)
|
raise cli_common.MissingArgumentError(message)
|
||||||
|
|
||||||
keystone_ep = cli_common.get_keystone_ep('{}:8080'.format(host),
|
keystone_ep = cli_common.get_keystone_ep(
|
||||||
auth_region)
|
'{}:{}'.format(host, base_config.rms['port']), auth_region)
|
||||||
if keystone_ep is None:
|
if keystone_ep is None:
|
||||||
raise ConnectionError(
|
raise ConnectionError(
|
||||||
'Failed in get_token, host: {}, region: {}'.format(host,
|
'Failed in get_token, host: {}, region: {}'.format(host,
|
||||||
@ -336,7 +337,7 @@ def get_path(args):
|
|||||||
|
|
||||||
def get_environment_variable(argument):
|
def get_environment_variable(argument):
|
||||||
# The rules are: all caps, underscores instead of dashes and prefixed
|
# The rules are: all caps, underscores instead of dashes and prefixed
|
||||||
environment_variable = 'AIC_ORM_{}'.format(
|
environment_variable = 'RANGER_{}'.format(
|
||||||
argument.replace('-', '_').upper())
|
argument.replace('-', '_').upper())
|
||||||
|
|
||||||
return os.environ.get(environment_variable)
|
return os.environ.get(environment_variable)
|
||||||
@ -345,7 +346,7 @@ def get_environment_variable(argument):
|
|||||||
def run(args):
|
def run(args):
|
||||||
url_path = get_path(args)
|
url_path = get_path(args)
|
||||||
host = args.orm_base_url if args.orm_base_url else config.orm_base_url
|
host = args.orm_base_url if args.orm_base_url else config.orm_base_url
|
||||||
port = args.port if args.port else 8080
|
port = args.port if args.port else base_config.rms['port']
|
||||||
data = args.datafile.read() if 'datafile' in args else '{}'
|
data = args.datafile.read() if 'datafile' in args else '{}'
|
||||||
timeout = args.timeout if args.timeout else 10
|
timeout = args.timeout if args.timeout else 10
|
||||||
rest_cmd, cmd_url = cmd_details(args)
|
rest_cmd, cmd_url = cmd_details(args)
|
||||||
|
@ -153,7 +153,7 @@ class TestOsExtraSpecsController(FunctionalTest):
|
|||||||
response = self.app.delete('/v1/orm/flavors/123/os_extra_specs',
|
response = self.app.delete('/v1/orm/flavors/123/os_extra_specs',
|
||||||
flavor_extra_specs_json,
|
flavor_extra_specs_json,
|
||||||
expect_errors=True)
|
expect_errors=True)
|
||||||
self.assertEqual(response.status_code, 500)
|
self.assertEqual(response.status_code, 400)
|
||||||
|
|
||||||
@patch.object(es, 'di')
|
@patch.object(es, 'di')
|
||||||
def test_delete_os_flavor_specs_flavor_not_found(self, mock_di):
|
def test_delete_os_flavor_specs_flavor_not_found(self, mock_di):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user