Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using tar bash comannd in sdk python #1545

Open
rbouali34 opened this issue Nov 14, 2019 · 1 comment
Open

using tar bash comannd in sdk python #1545

rbouali34 opened this issue Nov 14, 2019 · 1 comment

Comments

@rbouali34
Copy link

Hello,

i want to use a bash "tar -xzf" command in a python scrypt to uncompress an ucs file.

yyy=mgmt2.tm.util.bash.exec_cmd('run',utilCmdArgs="-c 'tar -xzf /var/local/ucs/tmp/migration/TEST.ucs'")

but I can not. I have a failure with this error msagge:

Python\Python37-32\lib\site-packages\f5\bigip\mixins.py", line 95, in getattr
raise LazyAttributesRequired(error_message)
f5.sdk_exception.LazyAttributesRequired: ('"allowed_lazy_attributes" not in', 'container._meta_data for class Bash')

I'm stuck if someone can help me

thank you

@jasonrahm
Copy link

Not sure what's causing your error there unless it's something I can't see. This works fine for me:

result = b.tm.util.bash.exec_cmd('run', utilCmdArgs='-c "tar -xzf /var/local/ucs/tmp/migration/TEST.ucs -C /var/tmp/test/"')

Note that if you don't use the -C option with tar, it will dump the extracted files in /var/service/restjavad, which is likely not the desired target.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants