from itertools import groupby
from operator import itemgetter
from sys import exc_info
-from time import time
+# from time import time
from uuid import uuid1 as generate_uuid
from six import reraise
'LIMIT {:d},{:d}').format(
self.safe_str(wim_account_id),
','.join(type_options),
- group_offset, group_limit
- )
+ group_offset, group_limit)
join = 'vim_wim_actions NATURAL JOIN ({}) AS items'.format(items)
db_results = self.db.get_rows(
'task_index': task_index}
try:
action = self.query_one('vim_wim_actions', WHERE=condition)
- except:
+ except Exception:
actions = self.query('vim_wim_actions', WHERE=condition)
self.logger.error('More then one action found:\n%s',
json.dumps(actions, indent=4))
updates = preprocess_record(
merge_dicts(action, properties, extra=extra))
- num_changes = self.db.update_rows('vim_wim_actions',
- UPDATE=updates, WHERE=condition)
+ num_changes = self.db.update_rows('vim_wim_actions', UPDATE=updates, WHERE=condition)
if num_changes is None:
raise UnexpectedDatabaseError(
if not changes:
return 0
- return self.db.update_rows('instance_actions',
- WHERE={'uuid': uuid}, UPDATE=changes)
+ return self.db.update_rows('instance_actions', WHERE={'uuid': uuid}, UPDATE=changes)
def get_only_vm_with_external_net(self, instance_net_id, **kwargs):
"""Return an instance VM if that is the only VM connected to an