Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Changes --reset to be a stringvar #6399
Conversation
wallyworld
reviewed
Oct 7, 2016
Initial review - looks similar to what's been done for model-defaults so +1 so far.
| + // make sure that we are not resetting because it is not valid to get and | ||
| + // reset simultaneously. | ||
| + if len(c.reset) > 0 { | ||
| + return errors.New("cannot set and retrieve default values simultaneously") |
| - args: []string{"--reset", "something", "weird"}, | ||
| - nilErr: true, | ||
| + args: []string{"--reset", "something", "weird"}, | ||
| + errorMatch: "cannot set and retrieve default values simultaneously", |
|
Also added more test cases. Let me know if you see any more corners. |
reedobrien
changed the title from
WIP: Changes --reset to be a stringvar
to
Changes --reset to be a stringvar
Oct 7, 2016
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
jujubot
merged commit 4159d57
into
juju:master
Oct 11, 2016
reedobrien
deleted the
reedobrien:feature/model-config-reset-as-string
branch
Oct 11, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
reedobrien commentedOct 7, 2016
•
Edited 1 time
-
reedobrien
Oct 7, 2016
Also allows reset and set to run in the same command, per the spec.
All tests pass at this point but it needs more tests
Refs: config command collapse spec https://goo.gl/yqrrPI
Refs: model-config-tree
QA:
With an lxd cloud like (see Faster LXD for details on apt-http proxy and other items, or don't use them)
juju bootstrap lxd-model-config lxdtestjuju model-configand verify no-proxy valueATTRIBUTE FROM VALUE
agent-metadata-url default ""
agent-stream default released
agent-version model 2.0.0.1
apt-ftp-proxy default ""
apt-http-proxy controller http://10.0.4.1:8000
apt-https-proxy default ""
apt-mirror default ""
automatically-retry-hooks default true
default-series controller xenial
development default false
disable-network-management default false
enable-os-refresh-update controller true
enable-os-upgrade controller false
firewall-mode default instance
ftp-proxy default ""
http-proxy default ""
https-proxy default ""
ignore-machine-addresses default false
image-metadata-url default ""
image-stream default released
logforward-enabled default false
logging-config model =DEBUG;unit=DEBUG
no-proxy controller https://lxd-no-regions
provisioner-harvest-mode default destroyed
proxy-ssh default false
resource-tags model {}
ssl-hostname-verification default true
test-mode default false
transmit-vendor-metrics default true
set no-proxy
juju model-config no-proxy=differentverify
juju model-config no-proxyisdifferentset others and reset no proxy
juju model-config agent-stream=devel apt-mirror=mirrorverify the keys are set
for k in apt-mirror agent-stream; do juju model-config $k; doneset these to be different and reset no-proxy
juju model-config agent-stream=stage --reset no-proxy apt-mirror=anothermirrorverify
for k in apt-mirror agent-stream no-proxy; do juju model-config $k; doneanothermirror
stage
https://lxd-no-regions
reset multiple and set multiple
juju model-config no-proxy=foo --reset agent-stream,apt-mirror default-series=yakketyverify
for k in apt-mirror agent-stream no-proxy default-series; do juju model-config $k; done""
released
foo
yakkety
Try invalid command
juju model-config no-proxy=foo --reset no-proxyerror: key "no-proxy" cannot be both set and reset in the same command
Try another
juju model-config no-proxy=foo no-proxy=barerror: key "no-proxy" specified more than once
Try multiple get
juju model-config no-proxy apt-mirrorerror: can only retrieve a single value, or all values
Try reset and get
juju model-config --reset no-proxy apt-mirrorerror: cannot set and retrieve model values simultaneously
Try things I didn't think about here
juju kill-controller -y lxd-model-config