Adhere python package requirements to Liberty global-requirements

What was done:
* versions of python packages that are requirements for the project
  changed to those from Liberty release;
* custom BaseRestController class changed to correlate with
  corresponding code of used pecan package version;
* fixed code of the orm models that become broken after installing
  SQLAlchemy package of different version

Blueprint: master-on-centos7

Is NOT compatible with CentOS6 master node

Related-Bug: #1516621

Change-Id: I9f5e600a0189d0d9fc0ae5b154254dc3a32a86c1
This commit is contained in:
Artem Roma 2015-11-23 17:32:11 +02:00 committed by Dmitry Teselkin
parent a98973482f
commit bfa90e5caa
4 changed files with 41 additions and 41 deletions

View File

@ -175,14 +175,14 @@ class Test(BASE):
session.query(cls).\
filter(cls.name == test_name,
cls.test_run_id == test_run_id).\
update(data, synchronize_session=False)
update(data, synchronize_session='fetch')
@classmethod
def update_running_tests(cls, session, test_run_id, status='stopped'):
session.query(cls). \
filter(cls.test_run_id == test_run_id,
cls.status.in_(('running', 'wait_running'))). \
update({'status': status}, synchronize_session=False)
update({'status': status}, synchronize_session='fetch')
@classmethod
def update_test_run_tests(cls, session, test_run_id,
@ -191,7 +191,7 @@ class Test(BASE):
filter(cls.name.in_(tests_names),
cls.test_run_id == test_run_id). \
update({'status': status, 'time_taken': None},
synchronize_session=False)
synchronize_session='fetch')
def copy_test(self, test_run, predefined_tests):
"""Performs copying of tests for newly created
@ -304,8 +304,13 @@ class TestRun(BASE):
test_run = cls(test_set_id=test_set, cluster_id=cluster_id,
status=status)
session.add(test_run)
for test in tests:
session.add(test.copy_test(test_run, predefined_tests))
new_test = test.copy_test(test_run, predefined_tests)
session.add(new_test)
test_run.tests.append(new_test)
session.flush()
return test_run
@classmethod
@ -343,7 +348,7 @@ class TestRun(BASE):
session.query(cls). \
filter(cls.id == test_run_id). \
update(updated_data, synchronize_session=False)
update(updated_data, synchronize_session='fetch')
@classmethod
def is_last_running(cls, session, test_set, cluster_id):
@ -364,9 +369,6 @@ class TestRun(BASE):
session, test_set.id,
metadata['cluster_id'], tests=tests)
# flush test_run data to db
session.commit()
plugin.run(test_run, test_set, dbpath,
metadata.get('ostf_os_access_creds'), token=token)

View File

@ -37,7 +37,7 @@ LOG = logging.getLogger(__name__)
class BaseRestController(rest.RestController):
def _handle_get(self, method, remainder):
def _handle_get(self, method, remainder, request=None):
if len(remainder):
method_name = remainder[0]
if method.upper() in self._custom_actions.get(method_name, []):
@ -47,7 +47,8 @@ class BaseRestController(rest.RestController):
)
if controller:
return controller, remainder[1:]
return super(BaseRestController, self)._handle_get(method, remainder)
return super(BaseRestController, self)._handle_get(method, remainder,
request)
class TestsetsController(BaseRestController):

View File

@ -73,5 +73,4 @@ class WsgiInterfaceTest(base.BaseWSGITest):
def test_get_last_testruns(self):
cluster_id = 1
self.mock_api_for_cluster(cluster_id)
self.app.get('/v1/testruns/last/{0}'.format(cluster_id))

View File

@ -1,32 +1,30 @@
oslo.config>=1.2.1,<1.10.0
oslo.config>=2.3.0
python-cinderclient>=1.0.7,<1.2.0
python-ceilometerclient>=1.0.9,<1.0.15
python-ironicclient>=0.3.3,<0.4.0
python-keystoneclient>=0.11,<1.4.0
python-muranoclient>=0.2.11,<0.6.0
python-novaclient>=2.17.0,<2.24.0
python-neutronclient>=2.3.6,<2.5.0
python-heatclient>=0.2.9,<0.5.0
python-glanceclient>=0.14.1,<0.18.0
python-saharaclient>=0.6.0,<0.9.0
python-cinderclient>=1.3.1
python-ceilometerclient>=1.5.0
python-keystoneclient>=1.6.0,!=1.8.0
python-muranoclient>=0.7.1
python-novaclient>=2.28.1,!=2.33.0
python-neutronclient>=2.6.0
python-heatclient>=0.3.0
python-glanceclient>=0.18.0
python-saharaclient>=0.10.0
paramiko>=1.10.1
requests!=2.4.0,<2.8.0
unittest2>=0.5.1
pyyaml>=3.10
testresources>=0.2.7
nose>=1.3.0
SQLAlchemy>=0.7.8,<=0.9.99
alembic>=0.5.0
amqp
anyjson
gevent==0.13.8
importlib
keystonemiddleware>=1.2.0,<1.6.0
kombu
oslo.serialization>=1.0.0,<1.5.0
oslo.utils<1.4.1
pecan>=0.3.0,<0.6.0
psycopg2>=2.5.1
stevedore>=0.10,<1.4.0
paramiko>=1.13.0
requests>=2.5.2,!=2.8.0
unittest2
PyYAML>=3.1.0
testresources>=0.2.4
nose
SQLAlchemy>=0.9.9,<1.1.0
alembic>=0.8.0
amqp>=1.4.0
anyjson>=0.3.3
gevent
keystonemiddleware>=2.0.0,!=2.4.0
kombu>=3.0.7
oslo.serialization>=1.4.0
oslo.utils>=2.0.0,!=2.6.0
pecan>=1.0.0
psycopg2>=2.5
stevedore>=1.5.0