Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quick fix for Omnibus CI #7373

Merged
merged 3 commits into from May 24, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 14 additions & 5 deletions acceptancetests/assess_budget.py
Expand Up @@ -14,11 +14,12 @@
from random import randint
import subprocess
import sys
import os

from deploy_stack import (
BootstrapManager,
)

from jujupy import (
client_from_config,
)
from utility import (
add_basic_testing_arguments,
JujuAssertionError,
Expand Down Expand Up @@ -245,8 +246,16 @@ def parse_args(argv):
def main(argv=None):
args = parse_args(argv)
configure_logging(args.verbose)
client = client_from_config(args.env, args.juju_bin, False)
assess_budget(client)
bs_manager = BootstrapManager.from_args(args)
with bs_manager.booted_context(args.upload_tools):
user_home = os.getenv('HOME', default='/var/lib/jenkins')
juju_home = os.getenv('JUJU_HOME',
default='/var/lib/jenkins/cloud-city')
ctrl_name = os.getenv('JOB_NAME', default='budget-management')
cookies_source = '{}/go-cookies-extended'.format(user_home)
cookies_target = '{}/jes-homes/{}/cookies/{}.json'.format(juju_home, ctrl_name, ctrl_name)
subprocess.call(['cp', cookies_source, cookies_target])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please wrap his in a function so that we can test it as well.

Perhaps wrapping some catch around the subprocess could add some nice debugging details.
Lastly, can we be certain that the 'cookies' directory exists? If not we might need to make it.

assess_budget(bs_manager.client)
return 0


Expand Down