From adb9c7d3687c8dee89af7a2c5141c1edafaae627 Mon Sep 17 00:00:00 2001 From: Maciej Kwiek Date: Wed, 23 Sep 2015 14:46:19 +0200 Subject: [PATCH] Install autocompletion for python-fuelclient Autocompletion is generated with errors until cliff error is fixed, we need to make small adjustment to autocompletion file for it to work. Change-Id: I44aa9f8a0615743b7eb77bc81723a7ddd110a600 Closes-Bug: #1474645 Related-Bug: #1374579 Related-Bug: #1499690 --- specs/python-fuelclient.spec | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/specs/python-fuelclient.spec b/specs/python-fuelclient.spec index 9421ca5c..32b4d43a 100644 --- a/specs/python-fuelclient.spec +++ b/specs/python-fuelclient.spec @@ -29,6 +29,7 @@ Requires: python-argparse Conflicts: python-requests == 2.8.0 +Requires: perl Requires: python-cliff >= 1.14.0 Requires: python-pbr >= 1.6 Requires: python-keystoneclient >= 1.6.0 @@ -37,6 +38,8 @@ Requires: python-requests >= 2.5.2 Requires: python-six >= 1.9.0 +Requires: bash-completion + %description Summary: Console utility for working with fuel rest api @@ -50,6 +53,10 @@ cd %{_builddir}/%{name}-%{version} && %{__python2} setup.py build rm -rf $RPM_BUILD_ROOT cd %{_builddir}/%{name}-%{version} && %{__python2} setup.py install --single-version-externally-managed -O1 --root=$RPM_BUILD_ROOT +%post +# FIXME(mkwiek): fix fuelclient to generate usable autocomplete bash +fuel2 complete | perl -pe "s/-(?=.*=')/_/g" | perl -pe 's;(?<=cmds_\$\{)proposed;proposed//-/_;g' | sed -e "s/local cur prev words/local -a words/g" > %{_datadir}/bash-completion/completions/fuel2 + %clean rm -rf $RPM_BUILD_ROOT