Code Review
/
yardstick.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge "Add pod.yaml files for Apex"
[yardstick.git]
/
yardstick
/
benchmark
/
scenarios
/
lib
/
delete_keypair.py
diff --git
a/yardstick/benchmark/scenarios/lib/delete_keypair.py
b/yardstick/benchmark/scenarios/lib/delete_keypair.py
index
1351399
..
a52a385
100644
(file)
--- a/
yardstick/benchmark/scenarios/lib/delete_keypair.py
+++ b/
yardstick/benchmark/scenarios/lib/delete_keypair.py
@@
-6,14
+6,12
@@
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
-
-from __future__ import print_function
-from __future__ import absolute_import
-
import logging
import logging
+from yardstick.common import openstack_utils
+from yardstick.common import exceptions
from yardstick.benchmark.scenarios import base
from yardstick.benchmark.scenarios import base
-import yardstick.common.openstack_utils as op_utils
+
LOG = logging.getLogger(__name__)
LOG = logging.getLogger(__name__)
@@
-26,11
+24,11
@@
class DeleteKeypair(base.Scenario):
def __init__(self, scenario_cfg, context_cfg):
self.scenario_cfg = scenario_cfg
self.context_cfg = context_cfg
def __init__(self, scenario_cfg, context_cfg):
self.scenario_cfg = scenario_cfg
self.context_cfg = context_cfg
- self.options = self.scenario_cfg[
'options'
]
+ self.options = self.scenario_cfg[
"options"
]
- self.key_name = self.options
.get("key_name", "yardstick_key")
+ self.key_name = self.options
["key_name"]
- self.
nova_client = op_utils.get_nova
_client()
+ self.
shade_client = openstack_utils.get_shade
_client()
self.setup_done = False
self.setup_done = False
@@
-45,12
+43,13
@@
class DeleteKeypair(base.Scenario):
if not self.setup_done:
self.setup()
if not self.setup_done:
self.setup()
- status = op
_utils.delete_keypair(self.nova
_client,
- self.key_name)
+ status = op
enstack_utils.delete_keypair(self.shade
_client,
+
self.key_name)
- if status:
- result.update({"delete_keypair": 1})
- LOG.info("Delete keypair successful!")
- else:
+ if not status:
result.update({"delete_keypair": 0})
result.update({"delete_keypair": 0})
- LOG.info("Delete keypair failed!")
+ LOG.error("Delete keypair failed!")
+ raise exceptions.ScenarioDeleteKeypairError
+
+ result.update({"delete_keypair": 1})
+ LOG.info("Delete keypair successful!")