diff options
author | Juha Kosonen <juha.kosonen@nokia.com> | 2016-01-27 23:56:46 +0000 |
---|---|---|
committer | Juha Kosonen <juha.kosonen@nokia.com> | 2016-01-27 23:58:34 +0000 |
commit | 9922669c3dd92d43c6e387c8077255153c35b71e (patch) | |
tree | ed3f631fd17cf58f042ade09bb5e561ada16d5f8 /testcases/functest_utils.py | |
parent | bf42faf9107d14a61a7b07a7276a3ab1c5a68618 (diff) |
Volume type management moved from run_tests.sh to run_rally-cert.py
Change-Id: I80c8b27e041ec5089b816b8515cbc8fa1e8b9eea
Signed-off-by: Juha Kosonen <juha.kosonen@nokia.com>
Diffstat (limited to 'testcases/functest_utils.py')
-rw-r--r-- | testcases/functest_utils.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/testcases/functest_utils.py b/testcases/functest_utils.py index 92ababcb..21fd8cc2 100644 --- a/testcases/functest_utils.py +++ b/testcases/functest_utils.py @@ -543,6 +543,36 @@ def delete_volume(cinder_client, volume_id, forced=False): return False +def list_volume_types(cinder_client, public=True, private=True): + try: + volume_types = cinder_client.volume_types.list() + if not public: + volume_types = [vt for vt in volume_types if not vt.is_public] + if not private: + volume_types = [vt for vt in volume_types if vt.is_public] + return volume_types + except: + return None + + +def create_volume_type(cinder_client, name): + try: + volume_type = cinder_client.volume_types.create(name) + return volume_type + except: + print "Error:", sys.exc_info()[0] + return None + + +def delete_volume_type(cinder_client, volume_type): + try: + cinder_client.volume_types.delete(volume_type) + return True + except: + print "Error:", sys.exc_info()[0] + return False + + #********************************************* # KEYSTONE |