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:
Chris Dent 2014-10-01 12:07:14 +01:00
parent 3ebb3f0b31
commit 51e76de9d2
1 changed files with 6 additions and 2 deletions

View File

@ -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()