The GQYLPY.
gqylpy / gqylpy-ssh Goto Github PK
View Code? Open in Web Editor NEW在远程服务器执行命令并得到执行结果,基于 paramiko 。
Home Page: http://gqylpy.com
License: GNU Lesser General Public License v2.1
在远程服务器执行命令并得到执行结果,基于 paramiko 。
Home Page: http://gqylpy.com
License: GNU Lesser General Public License v2.1
异常类 SSHCommandError
存于内部模块,无法被外部直接导入,无法仅处理它的异常。
当引发它时只能通过例如 except Exception
的方式处理,过于宽泛。
可选参数 auto_sudo
用于指示自动在命令前添加 sudo
指令。
当远程用户为超级用户时,该可选参数应始终无效,因为超级用户拥有足够的权限,无需 sudo
。
示例代码:
gssh.cmd('xx').raise_if_error()
引发的异常信息:
SSHCommandError: (xx && echo 4289077) bash: xx: command not found
可以看到,括号中包含自动追加的命令 && echo 4289077
。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.