diff --git a/server/src/uds/REST/methods/user_services.py b/server/src/uds/REST/methods/user_services.py index 2156ec663..5b8e6a887 100644 --- a/server/src/uds/REST/methods/user_services.py +++ b/server/src/uds/REST/methods/user_services.py @@ -274,6 +274,8 @@ class Publications(DetailHandler): Custom method "publish", provided to initiate a publication of a deployed service :param parent: Parent service pool ''' + changeLog = self._params['changelog'] if 'changelog' in self._params else None + if permissions.checkPermissions(self._user, parent, permissions.PERMISSION_MANAGEMENT) is False: logger.debug('Management Permission failed for user {}'.format(self._user)) self.accessDenied() diff --git a/server/src/uds/core/managers/PublicationManager.py b/server/src/uds/core/managers/PublicationManager.py index f195a35b2..28e689958 100644 --- a/server/src/uds/core/managers/PublicationManager.py +++ b/server/src/uds/core/managers/PublicationManager.py @@ -193,7 +193,7 @@ class PublicationManager(object): PublicationManager._manager = PublicationManager() return PublicationManager._manager - def publish(self, servicePool): # pylint: disable=no-self-use + def publish(self, servicePool, changeLog=None): # pylint: disable=no-self-use ''' Initiates the publication of a service pool, or raises an exception if this cannot be done :param servicePool: Service pool object (db object) @@ -208,6 +208,8 @@ class PublicationManager(object): now = getSqlDatetime() dsp = None dsp = servicePool.publications.create(state=State.LAUNCHING, state_date=now, publish_date=now, revision=servicePool.current_pub_revision) + if changeLog: + dsp.changelog.create(revision=servicePool.current_pub_revision, log=changeLog) DelayedTaskRunner.runner().insert(PublicationLauncher(dsp), 4, PUBTAG + str(dsp.id)) except Exception as e: logger.debug('Caught exception at publish: {0}'.format(e)) diff --git a/server/src/uds/models/ServicesPool.py b/server/src/uds/models/ServicesPool.py index 1a55c7775..0535ca0a1 100644 --- a/server/src/uds/models/ServicesPool.py +++ b/server/src/uds/models/ServicesPool.py @@ -55,7 +55,7 @@ from uds.models.Util import getSqlDatetime from datetime import timedelta import logging -__updated__ = '2015-05-01' +__updated__ = '2015-06-12' logger = logging.getLogger(__name__) @@ -326,14 +326,14 @@ class DeployedService(UUIDModel): # And generate a single list without duplicates return list(set([r for r in list1] + [r for r in list2])) - def publish(self): + def publish(self, changeLog=None): ''' Launches the publication of this deployed service. No check is done, it simply redirects the request to PublicationManager, where checks are done. ''' from uds.core.managers.PublicationManager import PublicationManager - PublicationManager.manager().publish(self) + PublicationManager.manager().publish(self, changeLog) def unpublish(self): ''' diff --git a/server/src/uds/reports/stats/usage.py b/server/src/uds/reports/stats/usage.py index 6e0c75b16..9e1af9690 100644 --- a/server/src/uds/reports/stats/usage.py +++ b/server/src/uds/reports/stats/usage.py @@ -37,10 +37,11 @@ from django.utils.translation import ugettext, ugettext_noop as _ from .base import StatsReport -__updated__ = '2015-04-28' +__updated__ = '2015-06-10' -class StatsReportUsage(StatsReport): +class StatsReportUsage(object): # Disabled from being used + # class StatsReportUsage(StatsReport): name = _('Usage stats') # Report name description = _('Statistics of platform use') # Report description uuid = '9ae54172-ed48-11e4-b8e1-10feed05884b' diff --git a/server/src/uds/services/OVirt/client/oVirtClient.py b/server/src/uds/services/OVirt/client/oVirtClient.py index 87a025563..61fe813ed 100644 --- a/server/src/uds/services/OVirt/client/oVirtClient.py +++ b/server/src/uds/services/OVirt/client/oVirtClient.py @@ -10,7 +10,7 @@ from ovirtsdk.api import API import threading import logging -__updated__ = '2015-06-09' +__updated__ = '2015-06-12' logger = logging.getLogger(__name__) @@ -65,7 +65,7 @@ class Client(object): pass try: cached_api_key = aKey - cached_api = API(url='https://' + self._host + '/api', username=self._username, password=self._password, timeout=self._timeout, insecure=True, debug=True) + cached_api = API(url='https://' + self._host + '/api', username=self._username, password=self._password, timeout=self._timeout, insecure=True, debug=False) return cached_api except: logger.exception('Exception connection ovirt at {0}'.format(self._host)) diff --git a/server/src/uds/templates/uds/admin/tmpl/publish.html b/server/src/uds/templates/uds/admin/tmpl/publish.html new file mode 100644 index 000000000..09f91f190 --- /dev/null +++ b/server/src/uds/templates/uds/admin/tmpl/publish.html @@ -0,0 +1,9 @@ +{% load i18n html5 %} +{% image_size as size %} +