Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
62b10d7
PY3: Replace "import thread" with "from six.moves import _thread as t…
chrisburr Aug 15, 2020
b9b6299
PY3: Replace "import urlparse" with "import six.moves.urllib.parse"
chrisburr Aug 15, 2020
4f3f839
PY3: Remove Python version check on import
chrisburr Aug 15, 2020
d285b56
PY3: Encode strings as UTF-8 before using hashlib.md5
chrisburr Aug 15, 2020
604de9c
PY3: Allow importing DEncode in Python 3 without actually porting it
chrisburr Aug 15, 2020
4bdc9b0
PY3: Replace "import Queue" with "from six.moves import queue as Queue"
chrisburr Aug 15, 2020
331c7ed
PY3: Replace "itertools.izip_longest" with "six.moves.zip_longest"
chrisburr Aug 15, 2020
58d240d
PY3: Get urllib2.URLError from six.moves.urllib_error
chrisburr Aug 15, 2020
846d8a6
PY3: Escape backslash in Core/Utilities/Grid.py
chrisburr Aug 15, 2020
0716316
PY3: Minimal types fixes to make pytest discovery functional
chrisburr Aug 15, 2020
5a66509
PY3: Remove MySQLdb.server_init if using mysqlclient
chrisburr Aug 15, 2020
7ece6c3
PY3: Replace StringIO with six.StringIO and six.BytesIO
chrisburr Aug 16, 2020
69f058b
PY3: Fix string type checking in Core/Utilities/Time.py
chrisburr Aug 16, 2020
8a4eaf1
PY3: Fallback to subprocess.getstatusoutput for commands.getstatusoutput
chrisburr Aug 16, 2020
c8c1f9d
Run pytest discovery with Python 3
chrisburr Aug 15, 2020
80e5466
Fix pycodestyle indentation errors
chrisburr Aug 17, 2020
bfa7ae9
Spelling corrections from code review
chrisburr Aug 17, 2020
fd23b16
Fix typo for test_types in Test_Encode.py
chrisburr Aug 21, 2020
5884f20
Fix typo in .github/workflows/basic-python3.yml
chrisburr Aug 25, 2020
305202c
Add pycurl and subprocess32 to environment-py3.yml
chrisburr Aug 25, 2020
5166756
PY3: Execute pytest skipping all directories
chrisburr Aug 17, 2020
54d6598
PY3: Run basic tests for ConfigurationSystem
chrisburr Aug 17, 2020
1d2af4b
PY3: Run most tests for Core
chrisburr Aug 21, 2020
6d1a7b3
PY3: Replace use of itervalues, iterkeys and iteritems
chrisburr Aug 21, 2020
ef16451
PY3: Make JDL and Workflow XML deterministic
chrisburr Aug 21, 2020
dc35239
PY3: Run tests for Interfaces
chrisburr Aug 21, 2020
ff82062
PY3: Fix use of dict.keys()
chrisburr Aug 24, 2020
7657856
PY3: Remove use of xrange
chrisburr Aug 24, 2020
1e6ae9d
PY3: Enable Resources unit tests
chrisburr Aug 25, 2020
343b8a3
PY3: Enable DataManagementSystem unit tests
chrisburr Aug 25, 2020
31ab404
PY3: Enable AccountingSystem and MonitoringSystem unit tests
chrisburr Aug 25, 2020
2eb6aef
PY3: Enable FrameworkSystem
chrisburr Aug 25, 2020
714a78d
PY3: Enable RequestManagementSystem tests
chrisburr Aug 25, 2020
5f8df52
PY3: Enable ResourceStatusSystem tests
chrisburr Aug 25, 2020
3d97a01
PY3: Enable WorkloadManagementSystem tests
chrisburr Aug 25, 2020
79564d4
PY3: Enable ProductionSystem, StorageManagementSystem and Workflow tests
chrisburr Aug 25, 2020
03d06f5
PY3: Enable TransformationSystem tests
chrisburr Aug 25, 2020
f5de43d
PY3: Enable unit tests except Core/DISET
chrisburr Aug 25, 2020
315a500
Core: use M2Crypto API for allowing proxy certificates
chaen Dec 20, 2019
21bcb92
PY3: Enable Core/DISET tests
chrisburr Aug 25, 2020
e1edc3b
Fix pycodestyle errors
chrisburr Aug 25, 2020
480561f
Support flakey unit tests and avoid https://github.com/pytest-dev/pyt…
chrisburr Aug 26, 2020
8612127
Review comments
chrisburr Aug 28, 2020
2088425
PY3: Fix proxy generation for encrypted certificates
chrisburr Aug 26, 2020
7d65d34
PY3: Convert isinstance(fd, file)
chrisburr Aug 26, 2020
2dd027f
Fix use of io.open in BundleDeliveryClient
chrisburr Aug 26, 2020
fc9c3c7
PY3: Get dirac-proxy-init and dirac-configure working
chrisburr Aug 26, 2020
7460927
PY3: Get DIRAC/tests/System/client_core.sh working
chrisburr Aug 26, 2020
59409b8
Add VOMS and python-gfal2 to Python 3 testing environment
chrisburr Aug 26, 2020
4ba6f80
PY3: Fix recieving bytes in ConfigurationSystem/private/Modificator.py
chrisburr Aug 26, 2020
604f1b3
PY3: Fix uploading sandboxes and submitting transformations
chrisburr Aug 26, 2020
a115c18
PY3: Fix proxy management encoding issues
chrisburr Aug 27, 2020
2c4def4
Fix pycodestyle errors
chrisburr Aug 27, 2020
9b48642
Add support for Python 3 in dirac-install.py
chrisburr Aug 31, 2020
4fe4b52
Handful of moderinisations
chrisburr Aug 31, 2020
d7c1bbc
Enable Python 3 client integration tests
chrisburr Aug 31, 2020
9a59dfe
PY3: Fix client integration tests
chrisburr Aug 31, 2020
c2e02ea
Remove pyGSI/M2Crypto tests and add job names for integration tests
chrisburr Aug 31, 2020
61b266c
Apply suggestions from code review
chrisburr Sep 17, 2020
502a104
Remove MySQLdb.server_init from Core/Utilities/MySQL.py
chrisburr Sep 17, 2020
2e324d9
Fix typos in comments
chrisburr Sep 17, 2020
e546964
Remove pointless .keys()
chrisburr Sep 17, 2020
f4a1c3f
Use six.moves.range in DIRACbenchmark.py
chrisburr Sep 17, 2020
b470993
Replace (int, long) with six.integer_types
chrisburr Sep 17, 2020
48b2242
Merge remote-tracking branch 'upstream/integration' into python3-clie…
chrisburr Oct 20, 2020
ad88c8a
PY3: Use bytes for PEM certificate data
chrisburr Oct 21, 2020
ba197f6
Use DIRACGrid orgnaisation for tornado and tornado_m2crypto
chrisburr Oct 21, 2020
28b94ac
PY3: Use surrogate escape instead of force_bytes parameter
chrisburr Oct 21, 2020
2d54b12
Review comment
chrisburr Oct 22, 2020
13d306c
Review comment
chrisburr Oct 22, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
42 changes: 42 additions & 0 deletions .github/workflows/basic-python3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Python 3 tests

on: [push, pull_request]

jobs:
check:
runs-on: ubuntu-latest
if: github.event_name != 'push' || github.repository == 'DIRACGrid/DIRAC'
timeout-minutes: 30

strategy:
fail-fast: False
matrix:
command:
# TODO These three tests fail on Python 3:
# * `test_BaseType_Unicode` and `test_nestedStructure` fail due to
# DISET's string and unicode types being poorly defined
# * `testLockedClass` deadlocks frequently due to the use of
# self.__processThread._Thread__stop(). Officially "threads
# cannot be destroyed, stopped, suspended, resumed, or
# interrupted" so the code should be rewritten to follow the
# supported alternative: "If you want your threads to stop
# gracefully, make them non-daemonic and use a suitable
# signalling mechanism such as an Event."
- pytest --no-cov -k 'not test_BaseType_Unicode and not test_nestedStructure and not testLockedClass'

steps:
- uses: actions/checkout@v2
- name: Fail-fast for outdated pipelines
run: .github/workflows/fail-fast.sh
- name: Prepare environment
run: |
conda env create --name dirac-testing --file environment-py3.yml
- name: Run tests
run: |
source "${CONDA}/bin/activate"
conda activate dirac-testing
set -euxo pipefail
export PYTHONPATH=${PWD%/*}
${{ matrix.command }}
env:
REFERENCE_BRANCH: ${{ github['base_ref'] || github['head_ref'] }}
42 changes: 22 additions & 20 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,42 +14,44 @@ jobs:
MATRIX_DEFAULT_ES_VER: 6.6.0
MATRIX_DEFAULT_USE_NEWTHREADPOOL: default
MATRIX_DEFAULT_DIRACOSVER: default
MATRIX_DEFAULT_SERVER_USE_M2CRYPTO: Yes
MATRIX_DEFAULT_CLIENT_USE_M2CRYPTO: Yes
MATRIX_DEFAULT_TEST_HTTPS: No
MATRIX_DEFAULT_SERVER_USE_PYTHON3: No
MATRIX_DEFAULT_CLIENT_USE_PYTHON3: No

strategy:
fail-fast: False
matrix:
# TEST_NAME is a dummy variable used to make it easier to read the web interface
include:
###### MySQL versions
- MYSQL_VER: 5.6
- TEST_NAME: "MySQL 5.6"
MYSQL_VER: 5.6
# IMPLICIT: - MYSQL_VER: 5.7
- MYSQL_VER: 8.0
- TEST_NAME: "MySQL 8.0"
MYSQL_VER: 8.0
###### ES versions
- ES_VER: 7.9.1
- TEST_NAME: "Elasticsearch 7.9.1"
ES_VER: 7.9.1
# IMPLICIT: - ES_VER: 6.6.0
###### Host OS
- HOST_OS: slc6
- TEST_NAME: "SLC 6"
HOST_OS: slc6
# IMPLICIT: - HOST_OS: cc7
###### Thread pool
# IMPLICIT: - USE_NEWTHREADPOOL: default
- USE_NEWTHREADPOOL: No
###### M2Crypto
# IMPLICIT: - SERVER_USE_M2CRYPTO: Yes
# CLIENT_USE_M2CRYPTO: Yes
- SERVER_USE_M2CRYPTO: Yes
CLIENT_USE_M2CRYPTO: No
- SERVER_USE_M2CRYPTO: No
CLIENT_USE_M2CRYPTO: Yes
- SERVER_USE_M2CRYPTO: No
CLIENT_USE_M2CRYPTO: No
- TEST_NAME: "New thread pool"
USE_NEWTHREADPOOL: No
###### HTTPS tests
# IMPLICIT: - DIRACOSVER: default
# TEST_HTTPS: No
- TEST_HTTPS: Yes
- TEST_NAME: "HTTPS"
TEST_HTTPS: Yes
DIRACOSVER: https

###### Python 3
# IMPLICIT: - SERVER_USE_PYTHON3: No
# CLIENT_USE_PYTHON3: No
- TEST_NAME: "Python 3 client"
CLIENT_USE_PYTHON3: Yes

steps:
- uses: actions/checkout@v2
Expand All @@ -73,8 +75,8 @@ jobs:
if [[ "${{ matrix.USE_NEWTHREADPOOL || env.MATRIX_DEFAULT_USE_NEWTHREADPOOL }}" != "default" ]]; then echo -n "-e DIRAC_USE_NEWTHREADPOOL=${{ matrix.USE_NEWTHREADPOOL || env.MATRIX_DEFAULT_USE_NEWTHREADPOOL }} " >> run_in_container; fi
if [[ "${{ matrix.DIRACOSVER || env.MATRIX_DEFAULT_DIRACOSVER }}" != "default" ]]; then echo -n "-e DIRACOSVER=${{ matrix.DIRACOSVER || env.MATRIX_DEFAULT_DIRACOSVER }} " >> run_in_container; fi
echo -n "-e TEST_HTTPS=${{ matrix.TEST_HTTPS || env.MATRIX_DEFAULT_TEST_HTTPS }} " >> run_in_container
echo -n "-e SERVER_USE_M2CRYPTO=${{ matrix.SERVER_USE_M2CRYPTO || env.MATRIX_DEFAULT_SERVER_USE_M2CRYPTO }} " >> run_in_container
echo -n "-e CLIENT_USE_M2CRYPTO=${{ matrix.CLIENT_USE_M2CRYPTO || env.MATRIX_DEFAULT_CLIENT_USE_M2CRYPTO }} " >> run_in_container
echo -n "-e SERVER_USE_PYTHON3=${{ matrix.SERVER_USE_PYTHON3 || env.MATRIX_DEFAULT_SERVER_USE_PYTHON3 }} " >> run_in_container
echo -n "-e CLIENT_USE_PYTHON3=${{ matrix.CLIENT_USE_PYTHON3 || env.MATRIX_DEFAULT_CLIENT_USE_PYTHON3 }} " >> run_in_container
# Finish wrapper script
echo -n "dirac-testing-host \"\$@\"" >> run_in_container
chmod +x run_in_container
Expand Down
4 changes: 2 additions & 2 deletions AccountingSystem/Agent/NetworkAgent.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def updateNameDictionary(self):
return S_ERROR('Unable to fetch perfSONAR endpoints from CS.')

tmpDict = {}
for path, value in result['Value'].iteritems():
for path, value in result['Value'].items():
if value == 'True':
elements = path.split('/')
diracName = elements[4]
Expand Down Expand Up @@ -211,7 +211,7 @@ def processMessage(self, headers, body):
OWDMax = 0
total = 0
count = 0
for value, items in metricData.iteritems():
for value, items in metricData.items():
floatValue = float(value)
total += floatValue * items
count += items
Expand Down
2 changes: 1 addition & 1 deletion AccountingSystem/Service/DataStoreHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def export_removeRegisters(self, entriesList):
for entry in entriesList:
if len(entry) != 4:
return S_ERROR("Invalid records")
for i in xrange(len(entry)):
for i in range(len(entry)):
if not isinstance(entry[i], expectedTypes[i]):
return S_ERROR("%s field in the records should be %s" % (i, expectedTypes[i]))
ok = 0
Expand Down
4 changes: 2 additions & 2 deletions AccountingSystem/private/MainReporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ def __calculateReportHash(self, reportRequest):
epoch = requestToHash[key]
requestToHash[key] = epoch - epoch % granularity
md5Hash = hashlib.md5()
md5Hash.update(repr(requestToHash))
md5Hash.update(self.setup)
md5Hash.update(repr(requestToHash).encode())
md5Hash.update(self.setup.encode())
return md5Hash.hexdigest()

def generate(self, reportRequest, credDict):
Expand Down
2 changes: 1 addition & 1 deletion AccountingSystem/private/Plotters/PilotPlotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def _plotJobsPerPilot(self, reportRequest, plotInfo, filename):
'endtime': reportRequest['endTime'],
'span': plotInfo['granularity'],
'ylabel': "jobs/pilot",
'normalization': max(x for y in plotInfo['data'].itervalues() for x in y.itervalues())}
'normalization': max(x for y in plotInfo['data'].values() for x in y.values())}
return self._generateQualityPlot(filename, plotInfo['data'], metadata)

def _reportTotalNumberOfPilots(self, reportRequest):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

import pprint
import sys
import urlparse
from six.moves.urllib import parse as urlparse
import cgi
from DIRAC import gLogger
from DIRAC.Core.Base import Script
Expand Down
8 changes: 4 additions & 4 deletions ConfigurationSystem/Agent/GOCDB2CSAgent.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def execute(self):
"""

# __functionMap is at the end of the class definition
for option, functionCall in GOCDB2CSAgent.__functionMap.iteritems():
for option, functionCall in GOCDB2CSAgent.__functionMap.items():
optionValue = self.am_getOption(option, True)
if optionValue:
result = functionCall(self)
Expand Down Expand Up @@ -157,12 +157,12 @@ def __preparePerfSONARConfiguration(self, endpointList):

split = endpoint['DIRACSITENAME'].split('.')
path = cfgPath(rootPath, split[0], endpoint['DIRACSITENAME'], extPath, endpoint['HOSTNAME'])
for name, defaultValue in options.iteritems():
for name, defaultValue in options.items():
newConfiguration[cfgPath(path, name)] = defaultValue

# get current configuration
currentConfiguration = {}
for option in options.iterkeys():
for option in options:
result = gConfig.getConfigurationTree(rootPath, extPath + '/', '/' + option)
if not result['OK']:
log.error("getConfigurationTree() failed with message: %s" % result['Message'])
Expand Down Expand Up @@ -242,7 +242,7 @@ def __updateConfiguration(self, setElements=None, delElements=None):
log.debug('Begin function ...')

# assure existence and proper value of a section or an option
for path, value in setElements.iteritems():
for path, value in setElements.items():

if value is None:
section = path
Expand Down
4 changes: 2 additions & 2 deletions ConfigurationSystem/Client/Helpers/CSGlobals.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
__RCSID__ = "$Id$"

import imp
import six
from DIRAC.Core.Utilities.DIRACSingleton import DIRACSingleton


@six.add_metaclass(DIRACSingleton)
class Extensions(object):
__metaclass__ = DIRACSingleton

def __init__(self):
self.__modules = {}
self.__orderedExtNames = []
Expand Down
2 changes: 1 addition & 1 deletion ConfigurationSystem/Client/Helpers/Operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
from __future__ import print_function

import six
import thread
from six.moves import _thread as thread
import os
from diraccfg import CFG
from DIRAC import S_OK, S_ERROR, gConfig
Expand Down
2 changes: 1 addition & 1 deletion ConfigurationSystem/Client/Helpers/Resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

__RCSID__ = "$Id$"

import urlparse
from six.moves.urllib import parse as urlparse
from distutils.version import LooseVersion # pylint: disable=no-name-in-module,import-error

import six
Expand Down
2 changes: 1 addition & 1 deletion ConfigurationSystem/Client/PathFinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

__RCSID__ = "$Id$"

import urlparse
from six.moves.urllib import parse as urlparse

from DIRAC.Core.Utilities import List
from DIRAC.ConfigurationSystem.Client.ConfigurationData import gConfigurationData
Expand Down
9 changes: 3 additions & 6 deletions ConfigurationSystem/Client/Utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import re
import socket
from urlparse import urlparse
from six.moves.urllib.parse import urlparse

import six

Expand Down Expand Up @@ -280,9 +280,7 @@ def addToChangeSet(entry, changeSet):
if submissionMode == "Unknown" and newSubmissionMode:
addToChangeSet((ceSection, 'SubmissionMode', submissionMode, newSubmissionMode), changeSet)

queues = ceInfo['Queues'].keys()
for queue in queues:
queueInfo = ceInfo['Queues'][queue]
for queue, queueInfo in ceInfo['Queues'].items():
queueStatus = queueInfo['GlueCEStateStatus']
queueSection = cfgPath(ceSection, 'Queues', queue)
queueDict = {}
Expand Down Expand Up @@ -470,8 +468,7 @@ def getGridSRMs(vo, bdiiInfo=None, srmBlackList=None, unUsed=False):

srmSeDict = {}
for site in siteSRMDict:
srms = siteSRMDict[site].keys()
for srm in srms:
for srm in siteSRMDict[site]:
if seBdiiDict.get(site, {}).get('SEs', {}).get(srm, {}):
srmSeDict.setdefault(site, {})
srmSeDict[site].setdefault(srm, {})
Expand Down
2 changes: 1 addition & 1 deletion ConfigurationSystem/private/ConfigurationClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def getConfigurationTree(self, root='', *filters):
if not options['OK']:
return S_ERROR("getOptionsDict() failed with message: %s" % options['Message'])

for key, value in options['Value'].iteritems():
for key, value in options['Value'].items():
path = cfgPath(root, key)
addOption = True
for substr in filters:
Expand Down
7 changes: 5 additions & 2 deletions ConfigurationSystem/private/ConfigurationData.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
import os.path
import zlib
import zipfile
import thread
import six
from six.moves import _thread as thread
import time
import DIRAC

Expand Down Expand Up @@ -87,7 +88,9 @@ def mergeWithLocal(self, extraCFG):
return S_OK()

def loadRemoteCFGFromCompressedMem(self, data):
sUncompressedData = zlib.decompress(data)
if six.PY3 and isinstance(data, str):
data = data.encode(errors="surrogateescape")
sUncompressedData = zlib.decompress(data).decode()
self.loadRemoteCFGFromMem(sUncompressedData)

def loadRemoteCFGFromMem(self, data):
Expand Down
28 changes: 23 additions & 5 deletions ConfigurationSystem/private/Modificator.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import zlib
import difflib
import six

from diraccfg import CFG
from DIRAC.Core.Utilities import List, Time
Expand Down Expand Up @@ -42,7 +43,10 @@ def loadFromRemote(self):
retVal = self.rpcClient.getCompressedData()
if retVal['OK']:
self.cfgData = CFG()
self.cfgData.loadFromBuffer(zlib.decompress(retVal['Value']))
data = retVal['Value']
if six.PY3 and isinstance(data, str):
data = data.encode(errors="surrogateescape")
self.cfgData.loadFromBuffer(zlib.decompress(data).decode())
return retVal

def getCFG(self):
Expand Down Expand Up @@ -251,24 +255,38 @@ def getHistory(self, limit=0):
def showCurrentDiff(self):
retVal = self.rpcClient.getCompressedData()
if retVal['OK']:
remoteData = zlib.decompress(retVal['Value']).splitlines()
data = retVal['Value']
if six.PY3 and isinstance(data, str):
data = data.encode(errors="surrogateescape")
remoteData = zlib.decompress(data).decode().splitlines()
localData = str(self.cfgData).splitlines()
return difflib.ndiff(remoteData, localData)
return []

def getVersionDiff(self, fromDate, toDate):
retVal = self.rpcClient.getVersionContents([fromDate, toDate])
if retVal['OK']:
fromData = zlib.decompress(retVal['Value'][0])
toData = zlib.decompress(retVal['Value'][1])
fromData = retVal['Value'][0]
if six.PY3 and isinstance(fromData, str):
fromData = fromData.encode(errors="surrogateescape")
fromData = zlib.decompress(fromData).decode()

toData = retVal['Value'][1]
if six.PY3 and isinstance(toData, str):
toData = toData.encode(errors="surrogateescape")
toData = zlib.decompress(toData).decode()

return difflib.ndiff(fromData.split("\n"), toData.split("\n"))
return []

def mergeWithServer(self):
retVal = self.rpcClient.getCompressedData()
if retVal['OK']:
remoteCFG = CFG()
remoteCFG.loadFromBuffer(zlib.decompress(retVal['Value']))
data = retVal['Value']
if six.PY3 and isinstance(data, str):
data = data.encode(errors="surrogateescape")
remoteCFG.loadFromBuffer(zlib.decompress(data).decode())
serverVersion = gConfigurationData.getVersion(remoteCFG)
self.cfgData = remoteCFG.mergeWith(self.cfgData)
gConfigurationData.setVersion(serverVersion, self.cfgData)
Expand Down
7 changes: 4 additions & 3 deletions ConfigurationSystem/private/Refresher.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ def _updateFromRemoteLocation(serviceClient):
retVal = serviceClient.getCompressedDataIfNewer(localVersion)
if retVal['OK']:
dataDict = retVal['Value']
if localVersion < dataDict['newestVersion']:
gLogger.debug("New version available", "Updating to version %s..." % dataDict['newestVersion'])
newestVersion = dataDict['newestVersion']
if localVersion < newestVersion:
gLogger.debug("New version available", "Updating to version %s..." % newestVersion)
gConfigurationData.loadRemoteCFGFromCompressedMem(dataDict['data'])
gLogger.debug("Updated to version %s" % gConfigurationData.getVersion())
gEventDispatcher.triggerEvent("CSNewVersion", dataDict['newestVersion'], threaded=True)
gEventDispatcher.triggerEvent("CSNewVersion", newestVersion, threaded=True)
return S_OK()
return retVal

Expand Down
Loading