资源简介
Ansible:一个非常简单的 IT 自动化平台 。让你的应用程序和系统更容易部署。
代码片段和文件信息
import json
import os
import os.path
import re
import sys
from collections import defaultdict
from distutils.command.build_scripts import build_scripts as Buildscripts
from distutils.command.sdist import sdist as SDist
try:
from setuptools import setup find_packages
from setuptools.command.build_py import build_py as BuildPy
from setuptools.command.install_lib import install_lib as InstallLib
from setuptools.command.install_scripts import install_scripts as Installscripts
except ImportError:
print(“Ansible now needs setuptools in order to build. Install it using“
“ your package manager (usually python-setuptools) or via pip (pip“
“ install setuptools).“)
sys.exit(1)
sys.path.insert(0 os.path.abspath(‘lib‘))
from ansible.release import __version__ __author__
SYMlink_CACHE = ‘SYMlink_CACHE.json‘
def _find_symlinks(topdir extension=‘‘):
“““Find symlinks that should be maintained
Maintained symlinks exist in the bin dir or are modules which have
aliases. Our heuristic is that they are a link in a certain path which
point to a file in the same directory.
“““
symlinks = defaultdict(list)
for base_path dirs files in os.walk(topdir):
for filename in files:
filepath = os.path.join(base_path filename)
if os.path.islink(filepath) and filename.endswith(extension):
target = os.readlink(filepath)
if os.path.dirname(target) == ‘‘:
link = filepath[len(topdir):]
if link.startswith(‘/‘):
link = link[1:]
symlinks[os.path.basename(target)].append(link)
return symlinks
def _cache_symlinks(symlink_data):
with open(SYMlink_CACHE ‘w‘) as f:
f.write(json.dumps(symlink_data))
def _maintain_symlinks(symlink_type base_path):
“““Switch a real file into a symlink“““
try:
# Try the cache first because going from git checkout to sdist is the
# only time we know that we‘re going to cache correctly
with open(SYMlink_CACHE ‘r‘) as f:
symlink_data = json.loads(f.read())
except (IOError OSError) as e:
# IOError on py2 OSError on py3. Both have errno
if e.errno == 2:
# SYMlinkS_CACHE doesn‘t exist. Fallback to trying to create the
# cache now. Will work if we‘re running directly from a git
# checkout or from an sdist created earlier.
symlink_data = {‘script‘: _find_symlinks(‘bin‘)
‘library‘: _find_symlinks(‘lib‘ ‘.py‘)
}
# Sanity check that something we know should be a symlink was
# found. We‘ll take that to mean that the current directory
# structure properly reflects symlinks in the git repo
if ‘ansible-playbook‘ in symlink_data[‘script‘][‘ansible‘]:
_cache_symlinks(symlink_data)
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-02-09 02:44 ansible-ansible-80fff4a\
文件 903 2018-02-09 02:44 ansible-ansible-80fff4a\.coveragerc
文件 99 2018-02-09 02:44 ansible-ansible-80fff4a\.gitattributes
文件 2370 2018-02-09 02:44 ansible-ansible-80fff4a\.gitignore
文件 0 2018-02-09 02:44 ansible-ansible-80fff4a\.gitmodules
文件 2200 2018-02-09 02:44 ansible-ansible-80fff4a\.mailmap
文件 39 2018-02-09 02:44 ansible-ansible-80fff4a\.yamllint
文件 200263 2018-02-09 02:44 ansible-ansible-80fff4a\CHANGELOG.md
文件 10490 2018-02-09 02:44 ansible-ansible-80fff4a\CODING_GUIDELINES.md
文件 1375 2018-02-09 02:44 ansible-ansible-80fff4a\CONTRIBUTING.md
文件 35148 2018-02-09 02:44 ansible-ansible-80fff4a\COPYING
文件 588 2018-02-09 02:44 ansible-ansible-80fff4a\MANIFEST.in
文件 200 2018-02-09 02:44 ansible-ansible-80fff4a\MODULE_GUIDELINES.md
文件 11912 2018-02-09 02:44 ansible-ansible-80fff4a\Makefile
文件 3692 2018-02-09 02:44 ansible-ansible-80fff4a\README.md
文件 3436 2018-02-09 02:44 ansible-ansible-80fff4a\RELEASES.txt
文件 1542 2018-02-09 02:44 ansible-ansible-80fff4a\ROADMAP.rst
文件 9 2018-02-09 02:44 ansible-ansible-80fff4a\VERSION
文件 78657 2018-02-09 02:44 ansible-ansible-80fff4a\ansible-core-sitemap.xm
目录 0 2018-02-09 02:44 ansible-ansible-80fff4a\bin\
文件 5846 2018-02-09 02:44 ansible-ansible-80fff4a\bin\ansible
文件 7 2018-02-09 02:44 ansible-ansible-80fff4a\bin\ansible-config
文件 9898 2018-02-09 02:44 ansible-ansible-80fff4a\bin\ansible-connection
文件 7 2018-02-09 02:44 ansible-ansible-80fff4a\bin\ansible-console
文件 7 2018-02-09 02:44 ansible-ansible-80fff4a\bin\ansible-doc
文件 7 2018-02-09 02:44 ansible-ansible-80fff4a\bin\ansible-galaxy
文件 7 2018-02-09 02:44 ansible-ansible-80fff4a\bin\ansible-inventory
文件 7 2018-02-09 02:44 ansible-ansible-80fff4a\bin\ansible-playbook
文件 7 2018-02-09 02:44 ansible-ansible-80fff4a\bin\ansible-pull
文件 7 2018-02-09 02:44 ansible-ansible-80fff4a\bin\ansible-vault
目录 0 2018-02-09 02:44 ansible-ansible-80fff4a\contrib\
............此处省略11836个文件信息
相关资源
- 量化投资:以Python为工具 高清完整PD
- 信用风险建模:理论基础、诊断工具
- oracle导出成dbf文件工具
- 模拟工具JT808.rar
- graphviz-2.38.msiwindows下python图形工具
- 免费轻松识别手写汉字工具-python
- JT808-2019协议测试工具
- Windows下 ReviewBoard 全套安装工具
- 量化投资:以Python为工具,代码和数
- struts漏洞检测工具
- cocos可用excel导表工具
- Python3.7.1
- Python-VoiceactivitydetectionVAD语音端点检测
- 量化投资:以Python为工具.蔡立耑(带
- python CAD 二次开发自动出图程序
- 《量化投资:以python为工具》课后习
- 数据之魅中文版:基于开源工具的数
- 量化投资以Python为工具高清
- 《量化投资:以Python为工具》课后习题
- Python-导出qq音乐歌单的小工具导出格
- 多边型标注工具python-opencv实现
- Python-autosub为任意视频自动生成字幕文
- 练手项目1(wxpython连连看)
- python+pygame一个好玩的小游戏
- Python3中的2to3转换工具使用
- 显著性目标检测、分割任务实验评价
- widerFace转VOC格式标注工具
- 桌面清理工具
- unitypackage文件解压工具
- splitAtlasEx.py
评论
共有 条评论