summaryrefslogtreecommitdiffstats
path: root/tests/nova_force_down.py
diff options
context:
space:
mode:
authorRyota MIBU <r-mibu@cq.jp.nec.com>2017-03-03 06:58:42 +0000
committerRyota MIBU <r-mibu@cq.jp.nec.com>2017-03-04 23:00:32 +0000
commit8f72e695538c2281f923bdbf7a6d7b1d1763c70c (patch)
tree6e5f9791ab340f0008cda575c605c47e64f97958 /tests/nova_force_down.py
parentf093b7f19e8cd6f76b26117b18b3c9e552ad5bcc (diff)
urgent bug fixes for danube (1)
- create "doctor_net" and use it in VM creation in order to avoid virtual network issues - make sample inspector use keystone v3 - use "openstack compute service set" for unset force_down - drop nova_force_down.py as keystone returns nova v2.1 - use '--os-project-name' except for ceilometer cli - avoid ping check (wait_ping) with empty "COMPUTE_IP" - add missing '$' in quota update args - move ping check (wait_ping) into unset_forced_down_hosts() and perform ping check only to downed compute hosts - use wait_until() instead of wait_ping() - put out unset_forced_down_hosts from collect_logs() JIRA: DOCTOR-95 Co-Authored-By: Carlos Goncalves <carlos.goncalves@neclab.eu> Change-Id: I3275ff5dd993b82029dac6a58087096baa251022 Signed-off-by: Ryota MIBU <r-mibu@cq.jp.nec.com>
Diffstat (limited to 'tests/nova_force_down.py')
-rw-r--r--tests/nova_force_down.py60
1 files changed, 0 insertions, 60 deletions
diff --git a/tests/nova_force_down.py b/tests/nova_force_down.py
deleted file mode 100644
index abea5671..00000000
--- a/tests/nova_force_down.py
+++ /dev/null
@@ -1,60 +0,0 @@
-##############################################################################
-# Copyright (c) 2016 NEC Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-import argparse
-import json
-import os
-
-from keystoneclient.v2_0 import client
-import requests
-
-
-def force_down(hostname, force_down=True):
- keystone = client.Client(username=os.environ['OS_USERNAME'],
- password=os.environ['OS_PASSWORD'],
- tenant_name=os.environ['OS_TENANT_NAME'],
- auth_url=os.environ['OS_AUTH_URL'])
-
- for service in keystone.auth_ref['serviceCatalog']:
- if service['type'] == 'compute':
- base_url = service['endpoints'][0]['internalURL']
- break
-
- url = '%s/os-services/force-down' % base_url.replace('/v2/', '/v2.1/')
- data = {
- 'forced_down': force_down,
- 'binary': 'nova-compute',
- 'host': hostname,
- }
- headers = {
- 'Content-Type': 'application/json',
- 'Accept': 'application/json',
- 'X-Auth-Token': keystone.auth_ref['token']['id'],
- 'X-OpenStack-Nova-API-Version': '2.11',
- }
-
- print requests.put(url, data=json.dumps(data), headers=headers)
-
-
-def get_args():
- parser = argparse.ArgumentParser(description='Doctor Test Cleaner')
- parser.add_argument('hostname', metavar='HOSTNAME', type=str, nargs='?',
- help='a nova-compute hostname to force down')
- parser.add_argument('--unset', action='store_true', default=False,
- help='unset force_down flag')
- return parser.parse_args()
-
-
-def main():
- args = get_args()
- force_down(args.hostname, not(args.unset))
-
-
-if __name__ == '__main__':
- main()