before empty after sending failure
ianmiell opened this issue · 1 comments
ianmiell commented
Minimal repro here:
imiell@Ians-Air:/space/git/shutit/bugs/install/bin (master)$ ./build.sh
with this diff:
imiell@Ians-Air:/space/git/shutit (master)$ git diff
diff --git a/.gitignore b/.gitignore
index 161ec2f..b6b7122 100644
--- a/.gitignore
+++ b/.gitignore
@@ -56,3 +56,4 @@ shutit.egg*
shutit.e4p
#bak
*bak
+bugs
diff --git a/shutit_pexpect.py b/shutit_pexpect.py
index f64c8d3..f06e327 100644
--- a/shutit_pexpect.py
+++ b/shutit_pexpect.py
@@ -982,15 +982,15 @@ class ShutItPexpectSession(object):
shutit = shutit_global.shutit
shutit.handle_note(note)
# THIS DOES NOT WORK - WHY? TODO
- #if self.current_environment.install_type == 'apt':
- # # v the space is intentional, to avoid polluting bash history.
- # return self.send_and_get_output(' dpkg -s ' + package + """ | grep '^Status: install ok installed' | wc -l""",loglevel=logging.DEBUG) == '1'
- #elif self.current_environment.install_type == 'yum':
- # # TODO: check whether it's already installed?. see yum notes yum list installed "$@" >/dev/null 2>&1
- # self.send(' yum list installed ' + package + ' > /dev/null 2>&1',check_exit=False,loglevel=logging.DEBUG)
- # return self.get_exit_value(shutit)
- #else:
- return False
+ if self.current_environment.install_type == 'apt':
+ # v the space is intentional, to avoid polluting bash history.
+ return self.send_and_get_output(' dpkg -s ' + package + """ | grep '^Status: install ok installed' | wc -l""",loglevel=logging.DEBUG) == '1'
+ elif self.current_environment.install_type == 'yum':
+ # TODO: check whether it's already installed?. see yum notes yum list installed "$@" >/dev/null 2>&1
+ self.send(' yum list installed ' + package + ' > /dev/null 2>&1',check_exit=False,loglevel=logging.DEBUG)
+ return self.get_exit_value(shutit)
+ else:
+ return False
ianmiell commented
OK, I think this was handled before in check_last_exit_value
At the moment that returns True if the last exit value was in the list, else False. Need to use retbool.
Still a mystery why.