--- admin/plib/modules/panel-migrator/backend/lib/python/parallels/plesk/source/plesk/hosting_description/provider/config.py +++ admin/plib/modules/panel-migrator/backend/lib/python/parallels/plesk/source/plesk/hosting_description/provider/config.py @@ -50,7 +50,7 @@ ALLOWED_LIMITS = { 'max_dom', 'disk_space', 'disk_space_soft', 'max_traffic', 'max_traffic_soft', 'max_box', 'mbox_quota', 'total_mbox_quota', 'total_mboxes_quota', 'max_wu', 'max_fpse_users' ,'max_subftp_users', 'max_db', 'max_mssql_db', 'mysql_dbase_space', 'mssql_dbase_space', 'max_maillists', 'max_webapps', 'max_subdom', 'max_dom_aliases', - 'max_iis_app_pools', 'max_shared_ssl_links', 'expiration', 'max_cf_dsn', 'max_cl', 'max_odbc', 'oversell', + 'max_iis_app_pools', 'max_shared_ssl_links', 'max_cf_dsn', 'max_cl', 'max_odbc', 'oversell', 'overuse', 'max_site', 'max_site_builder', 'max_mn', 'max_unity_mobile_sites', 'mssql_dbase_filesize', 'mssql_dbase_log_filesize', } --- admin/plib/modules/panel-migrator/backend/lib/python/parallels/plesk/source/plesk/hosting_description/provider/plesk.py +++ admin/plib/modules/panel-migrator/backend/lib/python/parallels/plesk/source/plesk/hosting_description/provider/plesk.py @@ -4,6 +4,8 @@ import posixpath import re import urllib +import time + from parallels.core.logging import get_logger from parallels.core.registry import Registry from parallels.core.reports.model.issue import Issue @@ -1680,7 +1682,12 @@ class PleskHostingDescriptionProvider(object): for name, value in plesk_limits.iteritems(): if self._is_limit_allowed(name): limits[name] = value + limits['overuse'] = self._get_overuse(plesk_limits, cl_params) + + if 'expiration' in plesk_limits: + limits['expiration'] = self._convert_expiration_date_format(plesk_limits['expiration']) + return limits @entity_data_dump(messages.DATA_DUMP_PERMISSIONS) @@ -1759,6 +1766,19 @@ class PleskHostingDescriptionProvider(object): overuse = 'notify' return overuse + @entity_data_dump(messages.DATA_DUMP_EXPIRATION_LIMIT) + def _convert_expiration_date_format(self, expiration): + """Convert expiration data format from database style (Unix timestamp) to backup dump style (YYYY-MM-DD) + + :type expiration: str | unicode + :rtype: str | unicode + """ + if is_empty(expiration) or expiration == "-1": + return "-1" + else: + time_struct = time.localtime(int(expiration)) + return '%04d-%02d-%02d' % (time_struct.tm_year, time_struct.tm_mon, time_struct.tm_mday) + def _encode_status(self, status): """ :type status: str|unicode --- admin/plib/modules/panel-migrator/backend/lib/python/parallels/plesk/source/plesk/messages/__init__.py +++ admin/plib/modules/panel-migrator/backend/lib/python/parallels/plesk/source/plesk/messages/__init__.py @@ -1322,6 +1322,9 @@ DATA_DUMP_MAILLISTS_SETTINGS = single_line_message(""" DATA_DUMP_LIMITS = single_line_message(""" Limits """) +DATA_DUMP_EXPIRATION_LIMIT = single_line_message(""" + Expiration date +""") DATA_DUMP_CL_PARAMS = single_line_message(""" Client (reseller) parameters """)