summaryrefslogtreecommitdiff
path: root/bash_completion
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2018-12-03 22:07:59 +0000
committerServer Team CI Bot <josh.powers+server-team-bot@canonical.com>2018-12-03 22:07:59 +0000
commit230e67ebd489c0d895243a2fc66ca95af2cea13b (patch)
tree652f4cec81d827012c964a38ffd12507c672e180 /bash_completion
parentadbd950af07a4b613a14bd83049915abdd6ca348 (diff)
downloadvyos-cloud-init-230e67ebd489c0d895243a2fc66ca95af2cea13b.tar.gz
vyos-cloud-init-230e67ebd489c0d895243a2fc66ca95af2cea13b.zip
dhclient-hook: cleanups, tests and fix a bug on 'down' event.
I noticed a bug in dhclient_hook on the 'down' event, using 'is' operator rather than '==' (if self.net_action is 'down'). This refactors/simplifies the code a bit for easier testing and adds tests. The reason for the rename of 'action' to 'event' is to just be internally consistent. The word and Namespace 'action' is used by cloud-init main, so it was not really usable here. Also adds a main which can easily be debugged with: CI_DHCP_HOOK_DATA_D=./my.d python -m cloudinit.dhclient_hook up eth0
Diffstat (limited to 'bash_completion')
-rw-r--r--bash_completion/cloud-init5
1 files changed, 4 insertions, 1 deletions
diff --git a/bash_completion/cloud-init b/bash_completion/cloud-init
index 8c25032f..a9577e9d 100644
--- a/bash_completion/cloud-init
+++ b/bash_completion/cloud-init
@@ -30,7 +30,10 @@ _cloudinit_complete()
devel)
COMPREPLY=($(compgen -W "--help schema net-convert" -- $cur_word))
;;
- dhclient-hook|features)
+ dhclient-hook)
+ COMPREPLY=($(compgen -W "--help up down" -- $cur_word))
+ ;;
+ features)
COMPREPLY=($(compgen -W "--help" -- $cur_word))
;;
init)