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:
hs571j 2018-05-18 14:53:16 -05:00 committed by Michael Glaser
parent e575ac52d9
commit 85f0e0f010
6 changed files with 19 additions and 15 deletions

View File

@ -2,6 +2,7 @@
import argparse
import cli_common
import config
import orm.base_config as base_config
import os
import requests
@ -358,8 +359,8 @@ def get_token(timeout, args, host):
print message
raise cli_common.MissingArgumentError(message)
keystone_ep = cli_common.get_keystone_ep('{}:8080'.format(host),
auth_region)
keystone_ep = cli_common.get_keystone_ep(
'{}:{}'.format(host, base_config.rms['port']), auth_region)
if keystone_ep is None:
raise ConnectionError(
'Failed in get_token, host: {}, region: {}'.format(host,
@ -386,7 +387,7 @@ def get_token(timeout, args, host):
def get_environment_variable(argument):
# The rules are: all caps, underscores instead of dashes and prefixed
environment_variable = 'AIC_ORM_{}'.format(
environment_variable = 'RANGER_{}'.format(
argument.replace('-', '_').upper())
return os.environ.get(environment_variable)

View File

@ -2,6 +2,7 @@
import argparse
import cli_common
import config
import orm.base_config as base_config
import os
import requests
@ -315,8 +316,8 @@ def get_token(timeout, args, host):
print message
raise cli_common.MissingArgumentError(message)
keystone_ep = cli_common.get_keystone_ep('{}:8080'.format(host),
auth_region)
keystone_ep = cli_common.get_keystone_ep(
'{}:{}'.format(host, base_config.rms['port']), auth_region)
if keystone_ep is None:
raise ConnectionError(
'Failed in get_token, host: {}, region: {}'.format(host,
@ -343,7 +344,7 @@ def get_token(timeout, args, host):
def get_environment_variable(argument):
# The rules are: all caps, underscores instead of dashes and prefixed
environment_variable = 'AIC_ORM_{}'.format(
environment_variable = 'RANGER_{}'.format(
argument.replace('-', '_').upper())
return os.environ.get(environment_variable)

View File

@ -1,6 +1,7 @@
#!/usr/bin/python
import argparse
import config
import orm.base_config as base_config
import os
import requests
@ -207,8 +208,8 @@ def get_token(timeout, args, host):
print message
raise cli_common.MissingArgumentError(message)
keystone_ep = cli_common.get_keystone_ep('{}:8080'.format(host),
auth_region)
keystone_ep = cli_common.get_keystone_ep(
'{}:{}'.format(host, base_config.rms['port']), auth_region)
if keystone_ep is None:
raise ConnectionError(
'Failed in get_token, host: {}, region: {}'.format(host,
@ -298,7 +299,7 @@ def cmd_data(args):
def get_environment_variable(argument):
# The rules are: all caps, underscores instead of dashes and prefixed
environment_variable = 'AIC_ORM_{}'.format(
environment_variable = 'RANGER_{}'.format(
argument.replace('-', '_').upper())
return os.environ.get(environment_variable)

View File

@ -2,6 +2,7 @@
import argparse
import cli_common
import config
import orm.base_config as base_config
import os
import requests
@ -232,8 +233,8 @@ def get_token(timeout, args, host):
print message
raise cli_common.MissingArgumentError(message)
keystone_ep = cli_common.get_keystone_ep('{}:8080'.format(host),
auth_region)
keystone_ep = cli_common.get_keystone_ep(
'{}:{}'.format(host, base_config.rms['port']), auth_region)
if keystone_ep is None:
raise ConnectionError(
'Failed in get_token, host: {}, region: {}'.format(host,
@ -336,7 +337,7 @@ def get_path(args):
def get_environment_variable(argument):
# The rules are: all caps, underscores instead of dashes and prefixed
environment_variable = 'AIC_ORM_{}'.format(
environment_variable = 'RANGER_{}'.format(
argument.replace('-', '_').upper())
return os.environ.get(environment_variable)
@ -345,7 +346,7 @@ def get_environment_variable(argument):
def run(args):
url_path = get_path(args)
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 '{}'
timeout = args.timeout if args.timeout else 10
rest_cmd, cmd_url = cmd_details(args)

View File

@ -153,7 +153,7 @@ class TestOsExtraSpecsController(FunctionalTest):
response = self.app.delete('/v1/orm/flavors/123/os_extra_specs',
flavor_extra_specs_json,
expect_errors=True)
self.assertEqual(response.status_code, 500)
self.assertEqual(response.status_code, 400)
@patch.object(es, 'di')
def test_delete_os_flavor_specs_flavor_not_found(self, mock_di):

View File

@ -1,6 +1,6 @@
[tox]
minversion = 2.0
envlist = py34,py27,pypy,pep8
envlist = py27,pep8
skipsdist = True
[testenv]