Allow javelin to run with incomplete resources.yaml
Make it possible to run javelin without all possible keys in resources.yaml by starting RES out as a defaultdict(list). Closes-Bug: #1376185 Change-Id: I78520fff501ce0716e5c7c07b435735aa08305d1
This commit is contained in:
parent
3ebb3f0b31
commit
51e76de9d2
|
@ -20,6 +20,7 @@ resources in a declarative way.
|
|||
"""
|
||||
|
||||
import argparse
|
||||
import collections
|
||||
import datetime
|
||||
import os
|
||||
import sys
|
||||
|
@ -43,7 +44,7 @@ from tempest.services.volume.json import volumes_client
|
|||
|
||||
OPTS = {}
|
||||
USERS = {}
|
||||
RES = {}
|
||||
RES = collections.defaultdict(list)
|
||||
|
||||
LOG = None
|
||||
|
||||
|
@ -508,6 +509,9 @@ def _get_volume_by_name(client, name):
|
|||
|
||||
|
||||
def create_volumes(volumes):
|
||||
if not volumes:
|
||||
return
|
||||
LOG.info("Creating volumes")
|
||||
for volume in volumes:
|
||||
client = client_for_user(volume['owner'])
|
||||
|
||||
|
@ -630,7 +634,7 @@ def main():
|
|||
global RES
|
||||
get_options()
|
||||
setup_logging()
|
||||
RES = load_resources(OPTS.resources)
|
||||
RES.update(load_resources(OPTS.resources))
|
||||
|
||||
if OPTS.mode == 'create':
|
||||
create_resources()
|
||||
|
|
Loading…
Reference in New Issue