Fix image uploader tool

This commit is contained in:
Joshua Harlow 2012-05-10 19:47:15 -07:00
parent d4ee017cde
commit 1d455b3eb7
2 changed files with 13 additions and 17 deletions

View File

@ -285,7 +285,7 @@ system auto-generate one for you you will need to check the final output
of the above install and pick up the password that was generated which of the above install and pick up the password that was generated which
should be displayed at key ``passwords/horizon_keystone_admin``. You can should be displayed at key ``passwords/horizon_keystone_admin``. You can
also later find this authentication information in the generated also later find this authentication information in the generated
``os-core.rc`` file. ``core.rc`` file.
If you see a login page and can access horizon then: If you see a login page and can access horizon then:
@ -298,7 +298,7 @@ In your ANVIL directory:
:: ::
source os-core.rc source core.rc
This should set up the environment variables you need to run OpenStack This should set up the environment variables you need to run OpenStack
CLI tools: CLI tools:

View File

@ -27,22 +27,17 @@ from anvil.components import glance
from anvil.helpers import uploader from anvil.helpers import uploader
class CfgProxy:
def __init__(self, cfg, pw_gen):
self.cfg = cfg
self.pw_gen = pw_gen
def get_config(): def get_config():
base_config = cfg.IgnoreMissingConfigParser()
config_location = cfg_helpers.find_config()
if config_location:
base_config.read([config_location])
config = cfg.ProxyConfig() config = cfg.ProxyConfig()
config.add_read_resolver(cfg.EnvResolver()) config.add_read_resolver(cfg.EnvResolver())
config.add_read_resolver(cfg.ConfigResolver(base_config)) config.add_read_resolver(cfg.ConfigResolver(cfg.IgnoreMissingConfigParser(fns=cfg_helpers.find_config())))
pw_gen = passwords.PasswordGenerator(config)
return (config, pw_gen) config.add_password_resolver(passwords.ConfigPassword(config))
config.add_password_resolver(passwords.InputPassword(config))
config.add_password_resolver(passwords.RandomPassword(config))
return config
def setup_logging(level): def setup_logging(level):
@ -74,5 +69,6 @@ if __name__ == "__main__":
cleaned_uris.append(uri) cleaned_uris.append(uri)
setup_logging(len(options.verbosity)) setup_logging(len(options.verbosity))
cfg, pw_gen = get_config() utils.welcome(prog_name="Image uploader tool")
uploader.Service(cfg, pw_gen).install(uris) cfg = get_config()
uploader.Service(cfg).install(uris)