检查工具的存在与是否可用
(self)
| 29 | |
| 30 | class Zip(object): |
| 31 | def __init__(self): |
| 32 | """ |
| 33 | 检查工具的存在与是否可用 |
| 34 | """ |
| 35 | # logger.info("初始化zip模块中...") |
| 36 | if not os.environ.get(ZIP_HOME, False): |
| 37 | raise NodeConfigError("the node does not have ZIP tool, please check.") |
| 38 | self.ZIP_TOOL_NAME = "7z" |
| 39 | if platform.platform().find("debian") >= 0: |
| 40 | logger.info("platform: %s" % platform.platform()) |
| 41 | logger.info( |
| 42 | "检测到在ubuntu系统中调用zip,因此将调用7z_ubuntu。(7z_ubuntu可能存在兼容问题,如果异常,请自行安装:sudo apt-get install p7zip-full)" |
| 43 | ) |
| 44 | self.ZIP_TOOL_NAME = "7z_ubuntu" |
| 45 | |
| 46 | def compress(self, path, zip_file): |
| 47 | """ |
nothing calls this directly
no test coverage detected