Skip to content
Snippets Groups Projects
Commit 70cd203782b4 authored by Vincent Hatakeyama's avatar Vincent Hatakeyama
Browse files

reorder imports, do not check version parts

parent 4b0f68b9216b
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,8 @@
"""
import argparse
import logging
import os
import pwd
import signal
from subprocess import call
import sys
......@@ -8,8 +9,7 @@
import pwd
import signal
from subprocess import call
import sys
import os
import ConfigParser
......@@ -26,5 +26,5 @@
_logger = logging.getLogger(__name__)
__version__ = '0.1.0'
__version__ = '0.1.1'
__date__ = '2017-08-11'
......@@ -30,11 +30,5 @@
__date__ = '2017-08-11'
__updated__ = '2017-09-07'
# Check the version of the "docker" package
if docker.__version__.split('.') < [2]:
print("the version of the docker package is {} instead of 1.9"
.format(docker.__version__))
sys.exit(1)
__updated__ = '2018-04-04'
def which(program):
......@@ -82,6 +76,5 @@
USAGE
''' % (program_shortdesc, str(__date__))
# TODO the script assume it is launched from the parent super project
project_path = os.path.realpath('.')
project_name = os.path.basename(project_path)
......@@ -86,5 +79,11 @@
project_path = os.path.realpath('.')
project_name = os.path.basename(project_path)
if project_name == 'odoo_scripts':
logging.fatal(
"You must run this script from the super project"
" (./odoo_scripts/docker_dev_start.py)")
return
setup_path = 'setup.cfg'
# TODO add a way to store configuration options in a project file
# Argument parsing
......@@ -210,12 +209,6 @@
start_postgresql = nmspc.start_postgresql
no_flake8 = nmspc.no_flake8
if project_name == 'odoo_scripts':
logging.fatal(
"You must run this script from the super project"
" (./odoo_scripts/docker_dev_start.py)")
return
c = ConfigParser.ConfigParser()
logging.debug('setup file path %s', setup_path)
# TODO test that setup file exists
......@@ -249,7 +242,7 @@
docker_client = docker_api(base_url='unix://var/run/docker.sock')
image_list = docker_client.images(name=image, quiet=True)
if not image_list:
logging.warn("Image %s does not exist", image)
logging.warning("Image %s does not exist", image)
else:
logging.info("Test image found")
......@@ -501,7 +494,7 @@
logging.info('Running flake8')
call(['flake8'])
else:
logging.warn('No flake8 in PATH')
logging.warning('No flake8 in PATH')
if start_postgresql:
# use docker-py to be able to stop both the database and odoo
......@@ -560,4 +553,5 @@
cmd.extend(options)
cmd.append(image)
cmd.extend(arg)
cmd.append('--dev=reload')
logging.debug(' '.join(cmd))
......@@ -563,5 +557,6 @@
logging.debug(' '.join(cmd))
call(cmd)
result = call(cmd)
return result
def createVolume(docker_client, data_volume_name):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment