juju-solutions / layer-cwr

Layer for building the Juju Jenkins CI env
Other
2 stars 5 forks source link

When registering a controller, there is an output about Juju being run for the first time. #116

Open seman opened 7 years ago

seman commented 7 years ago
$ juju run-action cwr/0 register-controller name=cwr-ctnrl token='df'
Action queued with id: 33db84d3-319d-4725-8995-d0be41750fe1
$ juju show-action-output 33db84d3-319d-4725-8995-d0be41750fe1
results:
  outcome: success
  output: "Started by user admin\nBuilding in workspace /var/lib/jenkins/jobs/RegisterController/workspace\n[workspace]
    $ /bin/sh -xe /tmp/hudson1835354836068095882.sh\n+ + juju register df
    pass\\npass\\ncwr-ctnrl\nSince Juju 2 is being run for the first time, downloading
    latest cloud information.\nFetching latest public cloud list...\nYour list of
    public clouds is up to date, see `juju clouds`.\nEnter a new password: \nConfirm
    password: \nInitial password successfully set for ciuser.\nEnter a name for this
    controller [cwr-ctnrl]: \nWelcome, ciuser. You are now logged into \"cwr-ctnrl\".\n\nThere
    are no models available. You can add models with\n\"juju add-model\", or you can
    ask an administrator or owner\nof a model to grant access to that model with \"juju
    grant\".\n+ sed -i.bak -e s/  cwr-ctnrl:/  cwr-ctnrl:\\n    password: pass/ /var/lib/jenkins/.local/share/juju/accounts.yaml\n+
    touch /var/lib/jenkins/controller.names\n+ echo cwr-ctnrl\nFinished: SUCCESS\n"
status: completed
timing:
  completed: 2017-03-17 19:03:14 +0000 UTC
  enqueued: 2017-03-17 19:02:58 +0000 UTC
  started: 2017-03-17 19:03:02 +0000 UTC
kwmonroe commented 7 years ago

Yeah, this happens because the jenkins user on the cwr unit is running juju for the first time. It's verbose and slightly annoying, but if for some reason the registration failed, we'd want that verbosity. We can probably tweak the action to hide that output if juju register succeeds, but that's a pretty low priority at the moment.