Issue #538 - Adding bash utility#690
Conversation
|
@caphrim007 and @zancas this is ready for review. Structurally I believe it is sound, but I wonder if we should allow any string in utilCmdArgs that doesn't start with "-c ..." since any other use of bash from REST would be useless. Thoughts appreciated. |
|
What would happen if I sent in FakeiControl.exec_cmd('run', utilsCmdArgs='env')? |
|
likely bad things. From: pjbreaux notifications@github.com What would happen if I sent in FakeiControl.exec_cmd('run', utilsCmdArgs='env')? — |
|
The actual answer is: "/bin/env: /bin/env: cannot execute binary file " So I'm guessing I should back off from testing for /bin/bash and just test for starting with /bin/ to catch any other unacceptable arguments passed to bash? |
|
@jgruber requested the functionality and really only needs support for bash -c..... But if there are other important use cases we need to allow, I want to be thorough. |
|
I'm for adding the restriction if it will help protect users and notify them of the requirement. And when we get a user that needs to do something without -c, then we can handle it then. |
|
Ok, I'll rework the code and resubmit tomorrow. Thanks for the feedback. |
|
looks like I'm short a test case in coveralls @caphrim007, I'll investigate. |
|
ok, @caphrim007, ready for review. |
|
|
||
| .. note:: | ||
|
|
||
| This is an unnamed resource so it has not ~Partition~Name pattern |
There was a problem hiding this comment.
"no" instead of "not". We will fix this in a follow-up PR
| 'run', | ||
| utilCmdArgs='-c df -k') | ||
|
|
||
| # commandResult should b present with data from 'df -k' |
There was a problem hiding this comment.
"be". Again, we'll fix it in a follow-up PR
|
thanks, I'll fix those with next command in util. |
Updated file:
f5/bigip/tm/util/init.py
Added files:
f5/bigip/tm/util/Bash.py
f5/bigip/tm/util/test/test_bash.py
test/functional/tm/util/test_bash.py