Fix setup file and reformat autocompose to fit setup requirements.

This commit is contained in:
Red5d
2016-01-02 23:11:51 -05:00
parent b80db6fa8f
commit 0f1a9e9308
2 changed files with 87 additions and 79 deletions

View File

@@ -3,10 +3,15 @@
import pyaml, argparse, sys import pyaml, argparse, sys
from docker import Client from docker import Client
def main():
parser = argparse.ArgumentParser(description='Generate docker-compose yaml definition from running container.') parser = argparse.ArgumentParser(description='Generate docker-compose yaml definition from running container.')
parser.add_argument('cname', type=str, help='The name of the container to process.') parser.add_argument('cname', type=str, help='The name of the container to process.')
args = parser.parse_args() args = parser.parse_args()
generate(args)
def generate(args):
c = Client(base_url='unix://var/run/docker.sock') c = Client(base_url='unix://var/run/docker.sock')
try: try:
@@ -95,3 +100,6 @@ for key in values:
# Render yaml file # Render yaml file
pyaml.p(cfile) pyaml.p(cfile)
if __name__ == "__main__":
main()

View File

@@ -3,10 +3,10 @@ setup(
name = "docker-autocompose", name = "docker-autocompose",
version = "1.0", version = "1.0",
packages = find_packages(), packages = find_packages(),
install_requires = ['pyaml, docker-py'], install_requires = ['pyaml>=15.8.2', 'docker-py>=1.6.0'],
entry_points={ entry_points={
'console_scripts': [ 'console_scripts': [
'autocompose = autocompose', 'autocompose = autocompose:main',
] ]
} }
) )