aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Brattain <ross.b.brattain@intel.com>2017-04-11 21:56:15 -0700
committerRoss Brattain <ross.b.brattain@intel.com>2017-07-12 06:21:20 +0000
commit29484c3071028df6c897797706117082a4b8c3f5 (patch)
tree430774f764f6266d5ddabe2827302008f5b9804d
parent0832b64daeeae389db660d87c139e82c1c6593f8 (diff)
constants: default SERVER_IP to 127.0.0.1
When running unittest while connected to P2P VPN, their is no default route, so we get None. Instead of using None, default to 127.0.0.1 Not sure why this was renamed to SERVER_IP either, what do we use this value for? Still getting py.test unittest failures all the time. The problem is we lookup influxdb.ip but SERVER_IP is None, so the lookup fails. INFLUXDB_IP = get_param('influxdb.ip', SERVER_IP) SERVER_IP can't ever be None Change-Id: Iedb09dc541137f7cdc6ef8d26dd312807985bfa8 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
-rw-r--r--yardstick/common/constants.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/yardstick/common/constants.py b/yardstick/common/constants.py
index d251341fc..c5a37b605 100644
--- a/yardstick/common/constants.py
+++ b/yardstick/common/constants.py
@@ -26,7 +26,15 @@ except KeyError:
SERVER_IP = '172.17.0.1'
else:
with IPDB() as ip:
- SERVER_IP = ip.routes['default'].gateway
+ try:
+ SERVER_IP = ip.routes['default'].gateway
+ except KeyError:
+ # during unittests ip.routes['default'] can be invalid
+ SERVER_IP = '127.0.0.1'
+
+if not SERVER_IP:
+ SERVER_IP = '127.0.0.1'
+
# dir
CONF_DIR = get_param('dir.conf', '/etc/yardstick')
your plugin title: Install Yardstick # Plugin version version: '0.9.0' # Description description: Installs Yardstick # Required fuel version fuel_version: ['9.0'] # Specify license of your plugin licenses: ['Apache License Version 2.0'] # Specify author or company name authors: ['john.hinman@intel.com','david.j.chou@intel.com','ruijing.guo@intel.com'] # A link to the plugin's page homepage: 'https://gerrit.opnfv.org/gerrit/yardstick' # Specify a group which your plugin implements, possible options: # network, storage, storage::cinder, storage::glance, hypervisor, # equipment groups: [] # Change `false` to `true` if the plugin can be installed in the environment # after the deployment. is_hotpluggable: true # Version of plugin package package_version: '4.0.0' # The plugin is compatible with releases in the list releases: - os: ubuntu version: mitaka-9.0 mode: ['ha'] deployment_scripts_path: deployment_scripts/ repository_path: repositories/ubuntu # Version of plugin package package_version: '4.0.0'