Merge "Decouple Fault Management from stx-config"
This commit is contained in:
commit
e1e60fd5d1
@ -20,11 +20,13 @@ Requires: python-six >= 1.9.0
|
||||
Requires: python-oslo-i18n >= 2.1.0
|
||||
Requires: python-oslo-utils >= 3.20.0
|
||||
Requires: python-requests
|
||||
Requires: bash-completion
|
||||
|
||||
%description
|
||||
A python client library for Fault Management
|
||||
|
||||
%define local_bindir /usr/bin/
|
||||
%define local_etc_bash_completiond /etc/bash_completion.d/
|
||||
%define pythonroot /usr/lib64/python2.7/site-packages
|
||||
|
||||
%define debug_package %{nil}
|
||||
@ -56,6 +58,9 @@ export PBR_VERSION=%{version}
|
||||
--install-data=/usr/share \
|
||||
--single-version-externally-managed
|
||||
|
||||
install -d -m 755 %{buildroot}%{local_etc_bash_completiond}
|
||||
install -p -D -m 664 tools/fm.bash_completion %{buildroot}%{local_etc_bash_completiond}/fm.bash_completion
|
||||
|
||||
# prep SDK package
|
||||
mkdir -p %{buildroot}/usr/share/remote-clients
|
||||
tar zcf %{buildroot}/usr/share/remote-clients/%{name}-%{version}.tgz --exclude='.gitignore' --exclude='.gitreview' -C .. %{name}-%{version}
|
||||
@ -68,6 +73,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%defattr(-,root,root,-)
|
||||
%doc LICENSE
|
||||
%{local_bindir}/*
|
||||
%{local_etc_bash_completiond}/*
|
||||
%{pythonroot}/%{pypi_name}/*
|
||||
%{pythonroot}/%{pypi_name}-%{version}*.egg-info
|
||||
|
||||
|
33
python-fmclient/fmclient/tools/fm.bash_completion
Normal file
33
python-fmclient/fmclient/tools/fm.bash_completion
Normal file
@ -0,0 +1,33 @@
|
||||
#
|
||||
# Copyright (c) 2018 Wind River Systems, Inc.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
# bash completion for Titanium Cloud fm commands
|
||||
|
||||
_fm_opts="" # lazy init
|
||||
_fm_flags="" # lazy init
|
||||
_fm_opts_exp="" # lazy init
|
||||
_fm()
|
||||
{
|
||||
local cur prev kbc
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
|
||||
if [ "x$_fm_opts" == "x" ] ; then
|
||||
kbc="`fm bash-completion | sed -e "s/ -h / /"`"
|
||||
_fm_opts="`echo "$kbc" | sed -e "s/--[a-z0-9_-]*//g" -e "s/[ ][ ]*/ /g"`"
|
||||
_fm_flags="`echo " $kbc" | sed -e "s/ [^-][^-][a-z0-9_-]*//g" -e "s/[ ][ ]*/ /g"`"
|
||||
_fm_opts_exp="`echo $_fm_opts | sed -e "s/[ ]/|/g"`"
|
||||
fi
|
||||
|
||||
if [[ " ${COMP_WORDS[@]} " =~ " "($_fm_opts_exp)" " && "$prev" != "help" ]] ; then
|
||||
COMPREPLY=($(compgen -W "${_fm_flags}" -- ${cur}))
|
||||
else
|
||||
COMPREPLY=($(compgen -W "${_fm_opts}" -- ${cur}))
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
complete -F _fm fm
|
Loading…
Reference in New Issue
Block a user