Refactoring provisioner

parent 9a50bd52
......@@ -4,9 +4,10 @@ python:
install:
- pip install tox
- pip install flake8-diff
script:
- cd core && tox -e $TOXENV_CORE
- git fetch origin $TRAVIS_BRANCH:travis_pr_branch
- flake8-diff travis_pr_branch
- cd core && tox -e $TOXENV_CORE
env:
- TOXENV_CORE=py27
- TOXENV_CORE=lint
\ No newline at end of file
......@@ -36,7 +36,8 @@ if __name__ == "__main__":
parser.add_argument('--ram_slave', type=int, dest='ram_slave', default=4096) # in MB
parser.add_argument('--disk_master', type=int, dest='disk_master', default=40) # in GB
parser.add_argument('--disk_slave', type=int, dest='disk_slave', default=40) # in GB
parser.add_argument('--ip_request', type=int, dest='ip_request', default=1)
parser.add_argument('--ip_alloc', type=str, dest='ip_alloc', default="master",
help="Choose between none, master, all")
parser.add_argument('--network_request', type=int, dest='network_request', default=1)
parser.add_argument('--image_name', type=str, dest='image_name', default='debian')
parser.add_argument('--action', type=str, dest='action', default='create')
......@@ -53,7 +54,7 @@ if __name__ == "__main__":
ram_slave=args.ram_slave,
disk_master=args.disk_master,
disk_slave=args.disk_slave,
ip_request=args.ip_request,
ip_allocation=args.ip_alloc,
network_request=args.network_request,
project_name=args.project_name)
......
This diff is collapsed.
......@@ -205,7 +205,8 @@ def test_find_flavor():
provisioner.cyclades.list_flavors.return_value = test_flavors
provisioner.create_vm(vm_name="tost", project_name="lambda.grnet.gr",
project_mode="supahpower", image_name="archlinux", net_id="12345")
project_mode="supahpower", image_name="archlinux", net_id="12345",
flavor={'id': 3})
provisioner.cyclades.create_server.assert_called_with(flavor_id=3,
image_id=u'c6f5adce-21ad-4ce3-8591-acfe7eb73c02',
name='tost',
......@@ -229,7 +230,7 @@ def test_check_all_resources():
vcpus=12,
ram=4096 * 3,
disk=180,
ip_request=1,
ip_allocation=all,
network_request=1)
......
......@@ -8,13 +8,12 @@ deps=
coverage
-rrequirements.txt
commands=
{envpython} setup.py install
; {envpython} setup.py install
pip install six pbr
coverage erase
coverage run {envbindir}/py.test
coverage report --include="*site-packages/fokia*" --omit=*test*
coverage xml --omit="*test*" --include="*site-packages/fokia*"
coverage run {envbindir}/py.test -l --tb=native
coverage report -i --include="*site-packages/fokia*" --omit=*test*
coverage xml -i --omit="*test*" --include="*site-packages/fokia*"
[testenv:lint]
deps=
......@@ -24,4 +23,4 @@ commands=
flake8 fokia
[flake8]
max-line-length = 100
max-line-length = 100
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment