diff --git a/confluent_client/confluent_env.sh b/confluent_client/confluent_env.sh index 97073971..e6ead5a6 100644 --- a/confluent_client/confluent_env.sh +++ b/confluent_client/confluent_env.sh @@ -156,6 +156,25 @@ _confluent_osimage_completion() fi } +_confluent_imgutil_completion() +{ + _confluent_get_args + if [ $NUMARGS == 2 ]; then + COMPREPLY=($(compgen -W "build exec pack" -- ${COMP_WORDS[COMP_CWORD]})) + return + elif [ ${CMPARGS[1]} == 'build' ]; then + COMPREPLY=($(compgen -W "-s $(ls /var/lib/confluent/distributions)" -- ${COMP_WORDS[COMP_CWORD]})) + return + elif [ ${CMPARGS[1]} == 'pack' ]; then + compopt -o dirnames + COMPREPLY=() + return + elif [ ${CMPARGS[1]} == 'exec' ]; then + compopt -o dirnames + COMPREPLY=($(compgen -W "-v" -- ${COMP_WORDS[COMP_CWORD]})) + return + fi +} _confluent_nodedeploy_completion() { _confluent_get_args @@ -302,6 +321,7 @@ complete -F _confluent_nr_completion nodeeventlog complete -F _confluent_nodefirmware_completion nodefirmware complete -F _confluent_nodedeploy_completion nodedeploy complete -F _confluent_osimage_completion osdeploy +complete -F _confluent_imgutil_completion imgutil complete -F _confluent_ng_completion nodegroupattrib complete -F _confluent_ng_completion nodegroupremove complete -F _confluent_nr_completion nodehealth diff --git a/imgutil/imgutil b/imgutil/imgutil index 5665c11d..ba25a649 100644 --- a/imgutil/imgutil +++ b/imgutil/imgutil @@ -316,6 +316,8 @@ def build_root(opts, args): check_root(args[0]) yumargs = ['yum', '--installroot={0}'.format(args[0])] if opts.source: + if '/' not in opts.source and not os.path.exists(opts.source): + opts.source = os.path.join('/var/lib/confluent/distributions/', opts.source) oshandler = fingerprint_source(opts.source) if oshandler is not None: oshandler.set_source(opts.source) @@ -337,6 +339,8 @@ def build_root(opts, args): def pack_image(opts, args): outdir = args[1] + if '/' not in outdir: + outdir = os.path.join('/var/lib/conflent/public/os/', outdir) kerns = glob.glob(os.path.join(args[0], 'boot/vmlinuz-*')) kvermap = {} for kern in kerns: