diff --git a/.github/workflows/basic-python3.yml b/.github/workflows/basic-python3.yml index 172322c786c..b765ead3052 100644 --- a/.github/workflows/basic-python3.yml +++ b/.github/workflows/basic-python3.yml @@ -23,6 +23,7 @@ jobs: # 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' + # - pytest --no-cov src/DIRAC/Core/Security/test steps: - uses: actions/checkout@v2 @@ -36,7 +37,7 @@ jobs: source "${CONDA}/bin/activate" conda activate dirac-testing set -euxo pipefail - export PYTHONPATH=${PWD%/*} + export PYTHONPATH=${PWD}/src ${{ matrix.command }} env: REFERENCE_BRANCH: ${{ github['base_ref'] || github['head_ref'] }} diff --git a/.github/workflows/basic.yml b/.github/workflows/basic.yml index 04b2edf0f35..a2f739b8ecc 100644 --- a/.github/workflows/basic.yml +++ b/.github/workflows/basic.yml @@ -13,7 +13,7 @@ jobs: matrix: command: - pytest --no-cov - - pytest --no-cov Core/Security/test + - pytest --no-cov src/DIRAC/Core/Security/test - tests/checkDocs.sh # TODO This should cover more than just tests/CI # Excluded codes related to sourcing files @@ -43,7 +43,7 @@ jobs: source "${CONDA}/bin/activate" conda activate dirac-testing set -euxo pipefail - export PYTHONPATH=${PWD%/*} + export PYTHONPATH=${PWD}/src ${{ matrix.command }} env: REFERENCE_BRANCH: ${{ github['base_ref'] || github['head_ref'] }} diff --git a/.github/workflows/diracinstall.yml b/.github/workflows/diracinstall.yml index c8119b33018..ed8a0aac484 100644 --- a/.github/workflows/diracinstall.yml +++ b/.github/workflows/diracinstall.yml @@ -27,4 +27,4 @@ jobs: - name: run dirac-install run: | eval "$(conda shell.bash hook)" && conda activate python_${{ matrix.python }} - python Core/scripts/dirac-install.py -l DIRAC -r integration -t server --dirac-os -ddd + python src/DIRAC/Core/scripts/dirac-install.py -l DIRAC -r integration -t server --dirac-os -ddd diff --git a/.github/workflows/pilotWrapper.yml b/.github/workflows/pilotWrapper.yml index fe5b4794a75..e8d2476f807 100644 --- a/.github/workflows/pilotWrapper.yml +++ b/.github/workflows/pilotWrapper.yml @@ -28,4 +28,4 @@ jobs: run: | cp tests/Integration/WorkloadManagementSystem/Test_GenerateAndExecutePilotWrapper.py . eval "$(conda shell.bash hook)" && conda activate python_${{ matrix.python }} - python Test_GenerateAndExecutePilotWrapper.py file://${{ github.workspace }}/WorkloadManagementSystem/Utilities/PilotWrapper.py file://${{ github.workspace }}/Core/scripts/dirac-install.py + python Test_GenerateAndExecutePilotWrapper.py file://${{ github.workspace }}/src/DIRAC/WorkloadManagementSystem/Utilities/PilotWrapper.py file://${{ github.workspace }}/src/DIRAC/Core/scripts/dirac-install.py diff --git a/container/Dockerfile b/container/Dockerfile index 7d627a8e433..9b654a5809f 100644 --- a/container/Dockerfile +++ b/container/Dockerfile @@ -24,7 +24,7 @@ RUN mkdir -p /opt/dirac/DIRAC && \ # Installing DIRAC in /opt/dirac RUN \ cd /opt/dirac && \ - curl -L -o dirac-install https://raw.githubusercontent.com/DIRACGrid/DIRAC/integration/Core/scripts/dirac-install.py && \ + curl -L -o dirac-install https://raw.githubusercontent.com/DIRACGrid/DIRAC/integration/src/DIRAC/Core/scripts/dirac-install.py && \ chmod +x dirac-install && \ ./dirac-install -r v6r20 -t server -i 27 -g v14r1 && \ rm -rf /opt/dirac/.installCache && \ diff --git a/docs/diracdoctools/Utilities.py b/docs/diracdoctools/Utilities.py index 4648b53d31b..1a2d80f0205 100644 --- a/docs/diracdoctools/Utilities.py +++ b/docs/diracdoctools/Utilities.py @@ -78,7 +78,7 @@ def setUpReadTheDocsEnvironment(moduleName='DIRAC'): """ LOG.info('Running for READTHEDOCS') sys.path.append(os.path.abspath('.')) - diracPath = os.path.abspath(os.path.join(os.getcwd(), '../..')) + diracPath = os.path.abspath(os.path.join(os.getcwd(), '../src')) LOG.info('Path To Module(?): %r', diracPath) buildfolder = '_build' @@ -86,13 +86,13 @@ def setUpReadTheDocsEnvironment(moduleName='DIRAC'): # We need to have the moduleName somewhere, or we cannot import it, as # readtheDocs clones the repo into something based on the branchname - if not os.path.exists(os.path.join('../../', moduleName)): + if not os.path.exists(os.path.join('../src', moduleName)): diracLink = os.path.abspath(os.path.join(os.getcwd(), '../', buildfolder, moduleName)) LOG.info('Link: %r', diracLink) if not os.path.exists(diracLink): LOG.info('Creating symbolic link %r -> %r', diracPath, diracLink) os.symlink(diracPath, diracLink) - diracPath = os.path.abspath(os.path.join(diracLink, '..')) + diracPath = os.path.abspath(os.path.join(diracLink, 'src')) sys.path.insert(0, diracPath) diff --git a/docs/docs.conf b/docs/docs.conf index 90e3dfa8f46..981d6ea520f 100644 --- a/docs/docs.conf +++ b/docs/docs.conf @@ -4,7 +4,7 @@ module_name = DIRAC # path to the source folder relative to docs.conf -source_folder = ../ +source_folder = ../src/DIRAC [Code] # building code reference diff --git a/docs/source/AdministratorGuide/Tutorials/basicTutoSetup.rst b/docs/source/AdministratorGuide/Tutorials/basicTutoSetup.rst index 3fd3c5c2f10..49d6e70adf1 100644 --- a/docs/source/AdministratorGuide/Tutorials/basicTutoSetup.rst +++ b/docs/source/AdministratorGuide/Tutorials/basicTutoSetup.rst @@ -214,7 +214,7 @@ the user's home folder): The output should look something like this:: - --2019-04-11 08:51:21-- https://github.com/DIRACGrid/DIRAC/raw/integration/Core/scripts/dirac-install.py + --2019-04-11 08:51:21-- https://github.com/DIRACGrid/DIRAC/raw/integration/src/DIRAC/Core/scripts/dirac-install.py Resolving github.com... 140.82.118.4, 140.82.118.3 Connecting to github.com|140.82.118.4|:443... connected. HTTP request sent, awaiting response... 302 Found diff --git a/docs/source/AdministratorGuide/Tutorials/basicTutoSetup.sh b/docs/source/AdministratorGuide/Tutorials/basicTutoSetup.sh index 2c58eb947ee..7bd7795a237 100644 --- a/docs/source/AdministratorGuide/Tutorials/basicTutoSetup.sh +++ b/docs/source/AdministratorGuide/Tutorials/basicTutoSetup.sh @@ -225,7 +225,7 @@ chown -R diracuser:diracuser ~diracuser/.globus/ cat > InstallDiracClient <`_. #. Create a directory where you will install DIRAC and WebAppDIRAC: mkdir portal; cd portal #. git clone git://github.com/zmathe/DIRAC.git. (NOTE: This works when you forked the DIRAC repository) or execute: git clone https://github.com/DIRACGrid/DIRAC.git #. git clone git://github.com/zmathe/WebAppDIRAC.git (NOTE: This works when you forked the WebAppDIRAC repository on github) or git clone ``_. -#. ./DIRAC/Core/scripts/dirac-install.py -r v6r21-pre1 -X -t server --dirac-os --dirac-os-version=0.0.6** (You can use the current production version of DIRAC which can found http://diracgrid.org. NOTE: The current version of dirac-os is 0.0.6 but this might change. The available versions can be found at http://lhcbproject.web.cern.ch/lhcbproject/dist/Dirac_project/installSource/.) +#. ./DIRAC/src/DIRAC/Core/scripts/dirac-install.py -r v6r21-pre1 -X -t server --dirac-os --dirac-os-version=0.0.6** (You can use the current production version of DIRAC which can found http://diracgrid.org. NOTE: The current version of dirac-os is 0.0.6 but this might change. The available versions can be found at http://lhcbproject.web.cern.ch/lhcbproject/dist/Dirac_project/installSource/.) #. python DIRAC/Core/scripts/dirac-deploy-scripts.py #. ./WebAppDIRAC/dirac-postInstall.py #. source bashrc (we have to use the correct python in order to install tornado) diff --git a/docs/source/UserGuide/GettingStarted/InstallingClient/index.rst b/docs/source/UserGuide/GettingStarted/InstallingClient/index.rst index a9bb0b3abd0..4d61528d192 100644 --- a/docs/source/UserGuide/GettingStarted/InstallingClient/index.rst +++ b/docs/source/UserGuide/GettingStarted/InstallingClient/index.rst @@ -20,7 +20,7 @@ Install script Download the *dirac-install* script from:: - wget -np -O dirac-install https://github.com/DIRACGrid/DIRAC/raw/integration/Core/scripts/dirac-install.py --no-check-certificate + wget -np -O dirac-install https://github.com/DIRACGrid/DIRAC/raw/integration/src/DIRAC/Core/scripts/dirac-install.py --no-check-certificate chmod +x dirac-install Choose the directory where you want to install the DIRAC software and run the dirac-install script from diff --git a/pytest.ini b/pytest.ini index 81dd39cb17f..da48ffa2065 100644 --- a/pytest.ini +++ b/pytest.ini @@ -5,4 +5,4 @@ python_files=Test_*.py assert*.py # The reason here is that we do nasty things with the pythonpath # in order to make sure that M2Crypto and pyGSI do not step # on each other's feet -addopts = -rx -v --color=yes --showlocals --tb=long --ignore=tests --ignore=Core/Security/test +addopts = -rx -v --color=yes --showlocals --tb=long --ignore=tests --ignore=src/DIRAC/Core/Security/test diff --git a/AccountingSystem/Agent/NetworkAgent.py b/src/DIRAC/AccountingSystem/Agent/NetworkAgent.py similarity index 100% rename from AccountingSystem/Agent/NetworkAgent.py rename to src/DIRAC/AccountingSystem/Agent/NetworkAgent.py diff --git a/AccountingSystem/Agent/__init__.py b/src/DIRAC/AccountingSystem/Agent/__init__.py similarity index 100% rename from AccountingSystem/Agent/__init__.py rename to src/DIRAC/AccountingSystem/Agent/__init__.py diff --git a/AccountingSystem/Agent/test/Test_NetworkAgent.py b/src/DIRAC/AccountingSystem/Agent/test/Test_NetworkAgent.py similarity index 100% rename from AccountingSystem/Agent/test/Test_NetworkAgent.py rename to src/DIRAC/AccountingSystem/Agent/test/Test_NetworkAgent.py diff --git a/AccountingSystem/Client/AccountingCLI.py b/src/DIRAC/AccountingSystem/Client/AccountingCLI.py similarity index 100% rename from AccountingSystem/Client/AccountingCLI.py rename to src/DIRAC/AccountingSystem/Client/AccountingCLI.py diff --git a/AccountingSystem/Client/DataStoreClient.py b/src/DIRAC/AccountingSystem/Client/DataStoreClient.py similarity index 100% rename from AccountingSystem/Client/DataStoreClient.py rename to src/DIRAC/AccountingSystem/Client/DataStoreClient.py diff --git a/AccountingSystem/Client/ReportCLI.py b/src/DIRAC/AccountingSystem/Client/ReportCLI.py similarity index 100% rename from AccountingSystem/Client/ReportCLI.py rename to src/DIRAC/AccountingSystem/Client/ReportCLI.py diff --git a/AccountingSystem/Client/ReportsClient.py b/src/DIRAC/AccountingSystem/Client/ReportsClient.py similarity index 100% rename from AccountingSystem/Client/ReportsClient.py rename to src/DIRAC/AccountingSystem/Client/ReportsClient.py diff --git a/AccountingSystem/Client/Types/BaseAccountingType.py b/src/DIRAC/AccountingSystem/Client/Types/BaseAccountingType.py similarity index 100% rename from AccountingSystem/Client/Types/BaseAccountingType.py rename to src/DIRAC/AccountingSystem/Client/Types/BaseAccountingType.py diff --git a/AccountingSystem/Client/Types/DataOperation.py b/src/DIRAC/AccountingSystem/Client/Types/DataOperation.py similarity index 100% rename from AccountingSystem/Client/Types/DataOperation.py rename to src/DIRAC/AccountingSystem/Client/Types/DataOperation.py diff --git a/AccountingSystem/Client/Types/Job.py b/src/DIRAC/AccountingSystem/Client/Types/Job.py similarity index 100% rename from AccountingSystem/Client/Types/Job.py rename to src/DIRAC/AccountingSystem/Client/Types/Job.py diff --git a/AccountingSystem/Client/Types/Network.py b/src/DIRAC/AccountingSystem/Client/Types/Network.py similarity index 100% rename from AccountingSystem/Client/Types/Network.py rename to src/DIRAC/AccountingSystem/Client/Types/Network.py diff --git a/AccountingSystem/Client/Types/Pilot.py b/src/DIRAC/AccountingSystem/Client/Types/Pilot.py similarity index 100% rename from AccountingSystem/Client/Types/Pilot.py rename to src/DIRAC/AccountingSystem/Client/Types/Pilot.py diff --git a/AccountingSystem/Client/Types/PilotSubmission.py b/src/DIRAC/AccountingSystem/Client/Types/PilotSubmission.py similarity index 100% rename from AccountingSystem/Client/Types/PilotSubmission.py rename to src/DIRAC/AccountingSystem/Client/Types/PilotSubmission.py diff --git a/AccountingSystem/Client/Types/StorageOccupancy.py b/src/DIRAC/AccountingSystem/Client/Types/StorageOccupancy.py similarity index 100% rename from AccountingSystem/Client/Types/StorageOccupancy.py rename to src/DIRAC/AccountingSystem/Client/Types/StorageOccupancy.py diff --git a/AccountingSystem/Client/Types/WMSHistory.py b/src/DIRAC/AccountingSystem/Client/Types/WMSHistory.py similarity index 100% rename from AccountingSystem/Client/Types/WMSHistory.py rename to src/DIRAC/AccountingSystem/Client/Types/WMSHistory.py diff --git a/AccountingSystem/Client/Types/__init__.py b/src/DIRAC/AccountingSystem/Client/Types/__init__.py similarity index 100% rename from AccountingSystem/Client/Types/__init__.py rename to src/DIRAC/AccountingSystem/Client/Types/__init__.py diff --git a/AccountingSystem/Client/__init__.py b/src/DIRAC/AccountingSystem/Client/__init__.py similarity index 100% rename from AccountingSystem/Client/__init__.py rename to src/DIRAC/AccountingSystem/Client/__init__.py diff --git a/AccountingSystem/ConfigTemplate.cfg b/src/DIRAC/AccountingSystem/ConfigTemplate.cfg similarity index 100% rename from AccountingSystem/ConfigTemplate.cfg rename to src/DIRAC/AccountingSystem/ConfigTemplate.cfg diff --git a/AccountingSystem/DB/AccountingDB.py b/src/DIRAC/AccountingSystem/DB/AccountingDB.py similarity index 100% rename from AccountingSystem/DB/AccountingDB.py rename to src/DIRAC/AccountingSystem/DB/AccountingDB.py diff --git a/AccountingSystem/DB/AccountingDB.sql b/src/DIRAC/AccountingSystem/DB/AccountingDB.sql similarity index 100% rename from AccountingSystem/DB/AccountingDB.sql rename to src/DIRAC/AccountingSystem/DB/AccountingDB.sql diff --git a/AccountingSystem/DB/MultiAccountingDB.py b/src/DIRAC/AccountingSystem/DB/MultiAccountingDB.py similarity index 100% rename from AccountingSystem/DB/MultiAccountingDB.py rename to src/DIRAC/AccountingSystem/DB/MultiAccountingDB.py diff --git a/AccountingSystem/DB/__init__.py b/src/DIRAC/AccountingSystem/DB/__init__.py similarity index 100% rename from AccountingSystem/DB/__init__.py rename to src/DIRAC/AccountingSystem/DB/__init__.py diff --git a/AccountingSystem/DB/test/Test_AccountingDB.py b/src/DIRAC/AccountingSystem/DB/test/Test_AccountingDB.py similarity index 100% rename from AccountingSystem/DB/test/Test_AccountingDB.py rename to src/DIRAC/AccountingSystem/DB/test/Test_AccountingDB.py diff --git a/AccountingSystem/Service/DataStoreHandler.py b/src/DIRAC/AccountingSystem/Service/DataStoreHandler.py similarity index 100% rename from AccountingSystem/Service/DataStoreHandler.py rename to src/DIRAC/AccountingSystem/Service/DataStoreHandler.py diff --git a/AccountingSystem/Service/ReportGeneratorHandler.py b/src/DIRAC/AccountingSystem/Service/ReportGeneratorHandler.py similarity index 100% rename from AccountingSystem/Service/ReportGeneratorHandler.py rename to src/DIRAC/AccountingSystem/Service/ReportGeneratorHandler.py diff --git a/AccountingSystem/Service/__init__.py b/src/DIRAC/AccountingSystem/Service/__init__.py similarity index 100% rename from AccountingSystem/Service/__init__.py rename to src/DIRAC/AccountingSystem/Service/__init__.py diff --git a/AccountingSystem/__init__.py b/src/DIRAC/AccountingSystem/__init__.py similarity index 100% rename from AccountingSystem/__init__.py rename to src/DIRAC/AccountingSystem/__init__.py diff --git a/AccountingSystem/private/DBUtils.py b/src/DIRAC/AccountingSystem/private/DBUtils.py similarity index 100% rename from AccountingSystem/private/DBUtils.py rename to src/DIRAC/AccountingSystem/private/DBUtils.py diff --git a/AccountingSystem/private/MainReporter.py b/src/DIRAC/AccountingSystem/private/MainReporter.py similarity index 100% rename from AccountingSystem/private/MainReporter.py rename to src/DIRAC/AccountingSystem/private/MainReporter.py diff --git a/AccountingSystem/private/Plotters/BaseReporter.py b/src/DIRAC/AccountingSystem/private/Plotters/BaseReporter.py similarity index 100% rename from AccountingSystem/private/Plotters/BaseReporter.py rename to src/DIRAC/AccountingSystem/private/Plotters/BaseReporter.py diff --git a/AccountingSystem/private/Plotters/DataOperationPlotter.py b/src/DIRAC/AccountingSystem/private/Plotters/DataOperationPlotter.py similarity index 100% rename from AccountingSystem/private/Plotters/DataOperationPlotter.py rename to src/DIRAC/AccountingSystem/private/Plotters/DataOperationPlotter.py diff --git a/AccountingSystem/private/Plotters/JobPlotter.py b/src/DIRAC/AccountingSystem/private/Plotters/JobPlotter.py similarity index 100% rename from AccountingSystem/private/Plotters/JobPlotter.py rename to src/DIRAC/AccountingSystem/private/Plotters/JobPlotter.py diff --git a/AccountingSystem/private/Plotters/NetworkPlotter.py b/src/DIRAC/AccountingSystem/private/Plotters/NetworkPlotter.py similarity index 100% rename from AccountingSystem/private/Plotters/NetworkPlotter.py rename to src/DIRAC/AccountingSystem/private/Plotters/NetworkPlotter.py diff --git a/AccountingSystem/private/Plotters/PilotPlotter.py b/src/DIRAC/AccountingSystem/private/Plotters/PilotPlotter.py similarity index 100% rename from AccountingSystem/private/Plotters/PilotPlotter.py rename to src/DIRAC/AccountingSystem/private/Plotters/PilotPlotter.py diff --git a/AccountingSystem/private/Plotters/PilotSubmissionPlotter.py b/src/DIRAC/AccountingSystem/private/Plotters/PilotSubmissionPlotter.py similarity index 100% rename from AccountingSystem/private/Plotters/PilotSubmissionPlotter.py rename to src/DIRAC/AccountingSystem/private/Plotters/PilotSubmissionPlotter.py diff --git a/AccountingSystem/private/Plotters/StorageOccupancyPlotter.py b/src/DIRAC/AccountingSystem/private/Plotters/StorageOccupancyPlotter.py similarity index 100% rename from AccountingSystem/private/Plotters/StorageOccupancyPlotter.py rename to src/DIRAC/AccountingSystem/private/Plotters/StorageOccupancyPlotter.py diff --git a/AccountingSystem/private/Plotters/WMSHistoryPlotter.py b/src/DIRAC/AccountingSystem/private/Plotters/WMSHistoryPlotter.py similarity index 100% rename from AccountingSystem/private/Plotters/WMSHistoryPlotter.py rename to src/DIRAC/AccountingSystem/private/Plotters/WMSHistoryPlotter.py diff --git a/AccountingSystem/private/Plotters/__init__.py b/src/DIRAC/AccountingSystem/private/Plotters/__init__.py similarity index 100% rename from AccountingSystem/private/Plotters/__init__.py rename to src/DIRAC/AccountingSystem/private/Plotters/__init__.py diff --git a/AccountingSystem/private/Policies/FilterExecutor.py b/src/DIRAC/AccountingSystem/private/Policies/FilterExecutor.py similarity index 100% rename from AccountingSystem/private/Policies/FilterExecutor.py rename to src/DIRAC/AccountingSystem/private/Policies/FilterExecutor.py diff --git a/AccountingSystem/private/Policies/JobPolicy.py b/src/DIRAC/AccountingSystem/private/Policies/JobPolicy.py similarity index 100% rename from AccountingSystem/private/Policies/JobPolicy.py rename to src/DIRAC/AccountingSystem/private/Policies/JobPolicy.py diff --git a/AccountingSystem/private/Policies/__init__.py b/src/DIRAC/AccountingSystem/private/Policies/__init__.py similarity index 100% rename from AccountingSystem/private/Policies/__init__.py rename to src/DIRAC/AccountingSystem/private/Policies/__init__.py diff --git a/AccountingSystem/private/__init__.py b/src/DIRAC/AccountingSystem/private/__init__.py similarity index 100% rename from AccountingSystem/private/__init__.py rename to src/DIRAC/AccountingSystem/private/__init__.py diff --git a/AccountingSystem/scripts/dirac-accounting-decode-fileid.py b/src/DIRAC/AccountingSystem/scripts/dirac-accounting-decode-fileid.py similarity index 100% rename from AccountingSystem/scripts/dirac-accounting-decode-fileid.py rename to src/DIRAC/AccountingSystem/scripts/dirac-accounting-decode-fileid.py diff --git a/AccountingSystem/scripts/dirac-admin-accounting-cli.py b/src/DIRAC/AccountingSystem/scripts/dirac-admin-accounting-cli.py similarity index 100% rename from AccountingSystem/scripts/dirac-admin-accounting-cli.py rename to src/DIRAC/AccountingSystem/scripts/dirac-admin-accounting-cli.py diff --git a/ConfigurationSystem/Agent/Bdii2CSAgent.py b/src/DIRAC/ConfigurationSystem/Agent/Bdii2CSAgent.py similarity index 100% rename from ConfigurationSystem/Agent/Bdii2CSAgent.py rename to src/DIRAC/ConfigurationSystem/Agent/Bdii2CSAgent.py diff --git a/ConfigurationSystem/Agent/GOCDB2CSAgent.py b/src/DIRAC/ConfigurationSystem/Agent/GOCDB2CSAgent.py similarity index 100% rename from ConfigurationSystem/Agent/GOCDB2CSAgent.py rename to src/DIRAC/ConfigurationSystem/Agent/GOCDB2CSAgent.py diff --git a/ConfigurationSystem/Agent/VOMS2CSAgent.py b/src/DIRAC/ConfigurationSystem/Agent/VOMS2CSAgent.py similarity index 100% rename from ConfigurationSystem/Agent/VOMS2CSAgent.py rename to src/DIRAC/ConfigurationSystem/Agent/VOMS2CSAgent.py diff --git a/ConfigurationSystem/Agent/__init__.py b/src/DIRAC/ConfigurationSystem/Agent/__init__.py similarity index 100% rename from ConfigurationSystem/Agent/__init__.py rename to src/DIRAC/ConfigurationSystem/Agent/__init__.py diff --git a/ConfigurationSystem/Agent/test/Test_Bdii2CS.py b/src/DIRAC/ConfigurationSystem/Agent/test/Test_Bdii2CS.py similarity index 100% rename from ConfigurationSystem/Agent/test/Test_Bdii2CS.py rename to src/DIRAC/ConfigurationSystem/Agent/test/Test_Bdii2CS.py diff --git a/ConfigurationSystem/Client/CSAPI.py b/src/DIRAC/ConfigurationSystem/Client/CSAPI.py similarity index 100% rename from ConfigurationSystem/Client/CSAPI.py rename to src/DIRAC/ConfigurationSystem/Client/CSAPI.py diff --git a/ConfigurationSystem/Client/CSCLI.py b/src/DIRAC/ConfigurationSystem/Client/CSCLI.py similarity index 100% rename from ConfigurationSystem/Client/CSCLI.py rename to src/DIRAC/ConfigurationSystem/Client/CSCLI.py diff --git a/ConfigurationSystem/Client/CSShellCLI.py b/src/DIRAC/ConfigurationSystem/Client/CSShellCLI.py similarity index 100% rename from ConfigurationSystem/Client/CSShellCLI.py rename to src/DIRAC/ConfigurationSystem/Client/CSShellCLI.py diff --git a/ConfigurationSystem/Client/Config.py b/src/DIRAC/ConfigurationSystem/Client/Config.py similarity index 100% rename from ConfigurationSystem/Client/Config.py rename to src/DIRAC/ConfigurationSystem/Client/Config.py diff --git a/ConfigurationSystem/Client/ConfigurationClient.py b/src/DIRAC/ConfigurationSystem/Client/ConfigurationClient.py similarity index 100% rename from ConfigurationSystem/Client/ConfigurationClient.py rename to src/DIRAC/ConfigurationSystem/Client/ConfigurationClient.py diff --git a/ConfigurationSystem/Client/ConfigurationData.py b/src/DIRAC/ConfigurationSystem/Client/ConfigurationData.py similarity index 100% rename from ConfigurationSystem/Client/ConfigurationData.py rename to src/DIRAC/ConfigurationSystem/Client/ConfigurationData.py diff --git a/ConfigurationSystem/Client/Helpers/CSGlobals.py b/src/DIRAC/ConfigurationSystem/Client/Helpers/CSGlobals.py similarity index 100% rename from ConfigurationSystem/Client/Helpers/CSGlobals.py rename to src/DIRAC/ConfigurationSystem/Client/Helpers/CSGlobals.py diff --git a/ConfigurationSystem/Client/Helpers/Local.py b/src/DIRAC/ConfigurationSystem/Client/Helpers/Local.py similarity index 100% rename from ConfigurationSystem/Client/Helpers/Local.py rename to src/DIRAC/ConfigurationSystem/Client/Helpers/Local.py diff --git a/ConfigurationSystem/Client/Helpers/Operations.py b/src/DIRAC/ConfigurationSystem/Client/Helpers/Operations.py similarity index 100% rename from ConfigurationSystem/Client/Helpers/Operations.py rename to src/DIRAC/ConfigurationSystem/Client/Helpers/Operations.py diff --git a/ConfigurationSystem/Client/Helpers/Path.py b/src/DIRAC/ConfigurationSystem/Client/Helpers/Path.py similarity index 100% rename from ConfigurationSystem/Client/Helpers/Path.py rename to src/DIRAC/ConfigurationSystem/Client/Helpers/Path.py diff --git a/ConfigurationSystem/Client/Helpers/Registry.py b/src/DIRAC/ConfigurationSystem/Client/Helpers/Registry.py similarity index 100% rename from ConfigurationSystem/Client/Helpers/Registry.py rename to src/DIRAC/ConfigurationSystem/Client/Helpers/Registry.py diff --git a/ConfigurationSystem/Client/Helpers/Resources.py b/src/DIRAC/ConfigurationSystem/Client/Helpers/Resources.py similarity index 100% rename from ConfigurationSystem/Client/Helpers/Resources.py rename to src/DIRAC/ConfigurationSystem/Client/Helpers/Resources.py diff --git a/ConfigurationSystem/Client/Helpers/ResourcesDefaults.py b/src/DIRAC/ConfigurationSystem/Client/Helpers/ResourcesDefaults.py similarity index 100% rename from ConfigurationSystem/Client/Helpers/ResourcesDefaults.py rename to src/DIRAC/ConfigurationSystem/Client/Helpers/ResourcesDefaults.py diff --git a/ConfigurationSystem/Client/Helpers/__init__.py b/src/DIRAC/ConfigurationSystem/Client/Helpers/__init__.py similarity index 100% rename from ConfigurationSystem/Client/Helpers/__init__.py rename to src/DIRAC/ConfigurationSystem/Client/Helpers/__init__.py diff --git a/ConfigurationSystem/Client/Helpers/test/Test_Helpers.py b/src/DIRAC/ConfigurationSystem/Client/Helpers/test/Test_Helpers.py similarity index 100% rename from ConfigurationSystem/Client/Helpers/test/Test_Helpers.py rename to src/DIRAC/ConfigurationSystem/Client/Helpers/test/Test_Helpers.py diff --git a/ConfigurationSystem/Client/LocalConfiguration.py b/src/DIRAC/ConfigurationSystem/Client/LocalConfiguration.py similarity index 100% rename from ConfigurationSystem/Client/LocalConfiguration.py rename to src/DIRAC/ConfigurationSystem/Client/LocalConfiguration.py diff --git a/ConfigurationSystem/Client/PathFinder.py b/src/DIRAC/ConfigurationSystem/Client/PathFinder.py similarity index 100% rename from ConfigurationSystem/Client/PathFinder.py rename to src/DIRAC/ConfigurationSystem/Client/PathFinder.py diff --git a/ConfigurationSystem/Client/SyncPlugins/CERNLDAPSyncPlugin.py b/src/DIRAC/ConfigurationSystem/Client/SyncPlugins/CERNLDAPSyncPlugin.py similarity index 100% rename from ConfigurationSystem/Client/SyncPlugins/CERNLDAPSyncPlugin.py rename to src/DIRAC/ConfigurationSystem/Client/SyncPlugins/CERNLDAPSyncPlugin.py diff --git a/ConfigurationSystem/Client/SyncPlugins/DummySyncPlugin.py b/src/DIRAC/ConfigurationSystem/Client/SyncPlugins/DummySyncPlugin.py similarity index 100% rename from ConfigurationSystem/Client/SyncPlugins/DummySyncPlugin.py rename to src/DIRAC/ConfigurationSystem/Client/SyncPlugins/DummySyncPlugin.py diff --git a/ConfigurationSystem/Client/SyncPlugins/__init__.py b/src/DIRAC/ConfigurationSystem/Client/SyncPlugins/__init__.py similarity index 100% rename from ConfigurationSystem/Client/SyncPlugins/__init__.py rename to src/DIRAC/ConfigurationSystem/Client/SyncPlugins/__init__.py diff --git a/ConfigurationSystem/Client/Utilities.py b/src/DIRAC/ConfigurationSystem/Client/Utilities.py similarity index 100% rename from ConfigurationSystem/Client/Utilities.py rename to src/DIRAC/ConfigurationSystem/Client/Utilities.py diff --git a/ConfigurationSystem/Client/VOMS2CSSynchronizer.py b/src/DIRAC/ConfigurationSystem/Client/VOMS2CSSynchronizer.py similarity index 100% rename from ConfigurationSystem/Client/VOMS2CSSynchronizer.py rename to src/DIRAC/ConfigurationSystem/Client/VOMS2CSSynchronizer.py diff --git a/ConfigurationSystem/Client/__init__.py b/src/DIRAC/ConfigurationSystem/Client/__init__.py similarity index 100% rename from ConfigurationSystem/Client/__init__.py rename to src/DIRAC/ConfigurationSystem/Client/__init__.py diff --git a/ConfigurationSystem/Client/test/Test_PathFinder.py b/src/DIRAC/ConfigurationSystem/Client/test/Test_PathFinder.py similarity index 100% rename from ConfigurationSystem/Client/test/Test_PathFinder.py rename to src/DIRAC/ConfigurationSystem/Client/test/Test_PathFinder.py diff --git a/ConfigurationSystem/ConfigTemplate.cfg b/src/DIRAC/ConfigurationSystem/ConfigTemplate.cfg similarity index 100% rename from ConfigurationSystem/ConfigTemplate.cfg rename to src/DIRAC/ConfigurationSystem/ConfigTemplate.cfg diff --git a/ConfigurationSystem/Service/ConfigurationHandler.py b/src/DIRAC/ConfigurationSystem/Service/ConfigurationHandler.py similarity index 100% rename from ConfigurationSystem/Service/ConfigurationHandler.py rename to src/DIRAC/ConfigurationSystem/Service/ConfigurationHandler.py diff --git a/ConfigurationSystem/Service/TornadoConfigurationHandler.py b/src/DIRAC/ConfigurationSystem/Service/TornadoConfigurationHandler.py similarity index 100% rename from ConfigurationSystem/Service/TornadoConfigurationHandler.py rename to src/DIRAC/ConfigurationSystem/Service/TornadoConfigurationHandler.py diff --git a/ConfigurationSystem/Service/__init__.py b/src/DIRAC/ConfigurationSystem/Service/__init__.py similarity index 100% rename from ConfigurationSystem/Service/__init__.py rename to src/DIRAC/ConfigurationSystem/Service/__init__.py diff --git a/ConfigurationSystem/__init__.py b/src/DIRAC/ConfigurationSystem/__init__.py similarity index 100% rename from ConfigurationSystem/__init__.py rename to src/DIRAC/ConfigurationSystem/__init__.py diff --git a/ConfigurationSystem/private/ConfigurationClient.py b/src/DIRAC/ConfigurationSystem/private/ConfigurationClient.py similarity index 100% rename from ConfigurationSystem/private/ConfigurationClient.py rename to src/DIRAC/ConfigurationSystem/private/ConfigurationClient.py diff --git a/ConfigurationSystem/private/ConfigurationData.py b/src/DIRAC/ConfigurationSystem/private/ConfigurationData.py similarity index 100% rename from ConfigurationSystem/private/ConfigurationData.py rename to src/DIRAC/ConfigurationSystem/private/ConfigurationData.py diff --git a/ConfigurationSystem/private/Modificator.py b/src/DIRAC/ConfigurationSystem/private/Modificator.py similarity index 100% rename from ConfigurationSystem/private/Modificator.py rename to src/DIRAC/ConfigurationSystem/private/Modificator.py diff --git a/ConfigurationSystem/private/Refresher.py b/src/DIRAC/ConfigurationSystem/private/Refresher.py similarity index 100% rename from ConfigurationSystem/private/Refresher.py rename to src/DIRAC/ConfigurationSystem/private/Refresher.py diff --git a/ConfigurationSystem/private/ServiceInterface.py b/src/DIRAC/ConfigurationSystem/private/ServiceInterface.py similarity index 100% rename from ConfigurationSystem/private/ServiceInterface.py rename to src/DIRAC/ConfigurationSystem/private/ServiceInterface.py diff --git a/ConfigurationSystem/private/ServiceInterfaceBase.py b/src/DIRAC/ConfigurationSystem/private/ServiceInterfaceBase.py similarity index 100% rename from ConfigurationSystem/private/ServiceInterfaceBase.py rename to src/DIRAC/ConfigurationSystem/private/ServiceInterfaceBase.py diff --git a/ConfigurationSystem/private/ServiceInterfaceTornado.py b/src/DIRAC/ConfigurationSystem/private/ServiceInterfaceTornado.py similarity index 100% rename from ConfigurationSystem/private/ServiceInterfaceTornado.py rename to src/DIRAC/ConfigurationSystem/private/ServiceInterfaceTornado.py diff --git a/ConfigurationSystem/private/__init__.py b/src/DIRAC/ConfigurationSystem/private/__init__.py similarity index 100% rename from ConfigurationSystem/private/__init__.py rename to src/DIRAC/ConfigurationSystem/private/__init__.py diff --git a/ConfigurationSystem/scripts/dirac-admin-add-resources.py b/src/DIRAC/ConfigurationSystem/scripts/dirac-admin-add-resources.py similarity index 100% rename from ConfigurationSystem/scripts/dirac-admin-add-resources.py rename to src/DIRAC/ConfigurationSystem/scripts/dirac-admin-add-resources.py diff --git a/ConfigurationSystem/scripts/dirac-admin-add-shifter.py b/src/DIRAC/ConfigurationSystem/scripts/dirac-admin-add-shifter.py similarity index 100% rename from ConfigurationSystem/scripts/dirac-admin-add-shifter.py rename to src/DIRAC/ConfigurationSystem/scripts/dirac-admin-add-shifter.py diff --git a/ConfigurationSystem/scripts/dirac-admin-add-site.py b/src/DIRAC/ConfigurationSystem/scripts/dirac-admin-add-site.py similarity index 100% rename from ConfigurationSystem/scripts/dirac-admin-add-site.py rename to src/DIRAC/ConfigurationSystem/scripts/dirac-admin-add-site.py diff --git a/ConfigurationSystem/scripts/dirac-admin-bdii-info.py b/src/DIRAC/ConfigurationSystem/scripts/dirac-admin-bdii-info.py similarity index 100% rename from ConfigurationSystem/scripts/dirac-admin-bdii-info.py rename to src/DIRAC/ConfigurationSystem/scripts/dirac-admin-bdii-info.py diff --git a/ConfigurationSystem/scripts/dirac-admin-check-config-options.py b/src/DIRAC/ConfigurationSystem/scripts/dirac-admin-check-config-options.py similarity index 100% rename from ConfigurationSystem/scripts/dirac-admin-check-config-options.py rename to src/DIRAC/ConfigurationSystem/scripts/dirac-admin-check-config-options.py diff --git a/ConfigurationSystem/scripts/dirac-admin-sort-cs-sites.py b/src/DIRAC/ConfigurationSystem/scripts/dirac-admin-sort-cs-sites.py similarity index 100% rename from ConfigurationSystem/scripts/dirac-admin-sort-cs-sites.py rename to src/DIRAC/ConfigurationSystem/scripts/dirac-admin-sort-cs-sites.py diff --git a/ConfigurationSystem/scripts/dirac-admin-voms-sync.py b/src/DIRAC/ConfigurationSystem/scripts/dirac-admin-voms-sync.py similarity index 100% rename from ConfigurationSystem/scripts/dirac-admin-voms-sync.py rename to src/DIRAC/ConfigurationSystem/scripts/dirac-admin-voms-sync.py diff --git a/ConfigurationSystem/scripts/dirac-configuration-cli.py b/src/DIRAC/ConfigurationSystem/scripts/dirac-configuration-cli.py similarity index 100% rename from ConfigurationSystem/scripts/dirac-configuration-cli.py rename to src/DIRAC/ConfigurationSystem/scripts/dirac-configuration-cli.py diff --git a/ConfigurationSystem/scripts/dirac-configuration-dump-local-cache.py b/src/DIRAC/ConfigurationSystem/scripts/dirac-configuration-dump-local-cache.py similarity index 100% rename from ConfigurationSystem/scripts/dirac-configuration-dump-local-cache.py rename to src/DIRAC/ConfigurationSystem/scripts/dirac-configuration-dump-local-cache.py diff --git a/ConfigurationSystem/scripts/dirac-configuration-shell.py b/src/DIRAC/ConfigurationSystem/scripts/dirac-configuration-shell.py similarity index 100% rename from ConfigurationSystem/scripts/dirac-configuration-shell.py rename to src/DIRAC/ConfigurationSystem/scripts/dirac-configuration-shell.py diff --git a/ConfigurationSystem/test/Test_agentOptions.py b/src/DIRAC/ConfigurationSystem/test/Test_agentOptions.py similarity index 100% rename from ConfigurationSystem/test/Test_agentOptions.py rename to src/DIRAC/ConfigurationSystem/test/Test_agentOptions.py diff --git a/Core/Base/API.py b/src/DIRAC/Core/Base/API.py similarity index 100% rename from Core/Base/API.py rename to src/DIRAC/Core/Base/API.py diff --git a/Core/Base/AgentModule.py b/src/DIRAC/Core/Base/AgentModule.py similarity index 100% rename from Core/Base/AgentModule.py rename to src/DIRAC/Core/Base/AgentModule.py diff --git a/Core/Base/AgentReactor.py b/src/DIRAC/Core/Base/AgentReactor.py similarity index 100% rename from Core/Base/AgentReactor.py rename to src/DIRAC/Core/Base/AgentReactor.py diff --git a/Core/Base/BaseTemplate.cfg b/src/DIRAC/Core/Base/BaseTemplate.cfg similarity index 100% rename from Core/Base/BaseTemplate.cfg rename to src/DIRAC/Core/Base/BaseTemplate.cfg diff --git a/Core/Base/CLI.py b/src/DIRAC/Core/Base/CLI.py similarity index 100% rename from Core/Base/CLI.py rename to src/DIRAC/Core/Base/CLI.py diff --git a/Core/Base/Client.py b/src/DIRAC/Core/Base/Client.py similarity index 100% rename from Core/Base/Client.py rename to src/DIRAC/Core/Base/Client.py diff --git a/Core/Base/DB.py b/src/DIRAC/Core/Base/DB.py similarity index 100% rename from Core/Base/DB.py rename to src/DIRAC/Core/Base/DB.py diff --git a/Core/Base/ElasticDB.py b/src/DIRAC/Core/Base/ElasticDB.py similarity index 100% rename from Core/Base/ElasticDB.py rename to src/DIRAC/Core/Base/ElasticDB.py diff --git a/Core/Base/ExecutorMindHandler.py b/src/DIRAC/Core/Base/ExecutorMindHandler.py similarity index 100% rename from Core/Base/ExecutorMindHandler.py rename to src/DIRAC/Core/Base/ExecutorMindHandler.py diff --git a/Core/Base/ExecutorModule.py b/src/DIRAC/Core/Base/ExecutorModule.py similarity index 100% rename from Core/Base/ExecutorModule.py rename to src/DIRAC/Core/Base/ExecutorModule.py diff --git a/Core/Base/ExecutorReactor.py b/src/DIRAC/Core/Base/ExecutorReactor.py similarity index 100% rename from Core/Base/ExecutorReactor.py rename to src/DIRAC/Core/Base/ExecutorReactor.py diff --git a/Core/Base/SQLAlchemyDB.py b/src/DIRAC/Core/Base/SQLAlchemyDB.py similarity index 100% rename from Core/Base/SQLAlchemyDB.py rename to src/DIRAC/Core/Base/SQLAlchemyDB.py diff --git a/Core/Base/Script.py b/src/DIRAC/Core/Base/Script.py similarity index 100% rename from Core/Base/Script.py rename to src/DIRAC/Core/Base/Script.py diff --git a/Core/Base/__init__.py b/src/DIRAC/Core/Base/__init__.py similarity index 100% rename from Core/Base/__init__.py rename to src/DIRAC/Core/Base/__init__.py diff --git a/Core/Base/private/ModuleLoader.py b/src/DIRAC/Core/Base/private/ModuleLoader.py similarity index 100% rename from Core/Base/private/ModuleLoader.py rename to src/DIRAC/Core/Base/private/ModuleLoader.py diff --git a/Core/Base/private/__init__.py b/src/DIRAC/Core/Base/private/__init__.py similarity index 100% rename from Core/Base/private/__init__.py rename to src/DIRAC/Core/Base/private/__init__.py diff --git a/Core/DISET/AuthManager.py b/src/DIRAC/Core/DISET/AuthManager.py similarity index 100% rename from Core/DISET/AuthManager.py rename to src/DIRAC/Core/DISET/AuthManager.py diff --git a/Core/DISET/MessageClient.py b/src/DIRAC/Core/DISET/MessageClient.py similarity index 100% rename from Core/DISET/MessageClient.py rename to src/DIRAC/Core/DISET/MessageClient.py diff --git a/Core/DISET/RPCClient.py b/src/DIRAC/Core/DISET/RPCClient.py similarity index 100% rename from Core/DISET/RPCClient.py rename to src/DIRAC/Core/DISET/RPCClient.py diff --git a/Core/DISET/RequestHandler.py b/src/DIRAC/Core/DISET/RequestHandler.py similarity index 100% rename from Core/DISET/RequestHandler.py rename to src/DIRAC/Core/DISET/RequestHandler.py diff --git a/Core/DISET/ServiceReactor.py b/src/DIRAC/Core/DISET/ServiceReactor.py similarity index 100% rename from Core/DISET/ServiceReactor.py rename to src/DIRAC/Core/DISET/ServiceReactor.py diff --git a/Core/DISET/ThreadConfig.py b/src/DIRAC/Core/DISET/ThreadConfig.py similarity index 100% rename from Core/DISET/ThreadConfig.py rename to src/DIRAC/Core/DISET/ThreadConfig.py diff --git a/Core/DISET/TransferClient.py b/src/DIRAC/Core/DISET/TransferClient.py similarity index 100% rename from Core/DISET/TransferClient.py rename to src/DIRAC/Core/DISET/TransferClient.py diff --git a/Core/DISET/__init__.py b/src/DIRAC/Core/DISET/__init__.py similarity index 100% rename from Core/DISET/__init__.py rename to src/DIRAC/Core/DISET/__init__.py diff --git a/Core/DISET/private/BaseClient.py b/src/DIRAC/Core/DISET/private/BaseClient.py similarity index 100% rename from Core/DISET/private/BaseClient.py rename to src/DIRAC/Core/DISET/private/BaseClient.py diff --git a/Core/DISET/private/FileHelper.py b/src/DIRAC/Core/DISET/private/FileHelper.py similarity index 100% rename from Core/DISET/private/FileHelper.py rename to src/DIRAC/Core/DISET/private/FileHelper.py diff --git a/Core/DISET/private/GatewayService.py b/src/DIRAC/Core/DISET/private/GatewayService.py similarity index 100% rename from Core/DISET/private/GatewayService.py rename to src/DIRAC/Core/DISET/private/GatewayService.py diff --git a/Core/DISET/private/InnerRPCClient.py b/src/DIRAC/Core/DISET/private/InnerRPCClient.py similarity index 100% rename from Core/DISET/private/InnerRPCClient.py rename to src/DIRAC/Core/DISET/private/InnerRPCClient.py diff --git a/Core/DISET/private/LockManager.py b/src/DIRAC/Core/DISET/private/LockManager.py similarity index 100% rename from Core/DISET/private/LockManager.py rename to src/DIRAC/Core/DISET/private/LockManager.py diff --git a/Core/DISET/private/MessageBroker.py b/src/DIRAC/Core/DISET/private/MessageBroker.py similarity index 100% rename from Core/DISET/private/MessageBroker.py rename to src/DIRAC/Core/DISET/private/MessageBroker.py diff --git a/Core/DISET/private/MessageFactory.py b/src/DIRAC/Core/DISET/private/MessageFactory.py similarity index 100% rename from Core/DISET/private/MessageFactory.py rename to src/DIRAC/Core/DISET/private/MessageFactory.py diff --git a/Core/DISET/private/Protocols.py b/src/DIRAC/Core/DISET/private/Protocols.py similarity index 100% rename from Core/DISET/private/Protocols.py rename to src/DIRAC/Core/DISET/private/Protocols.py diff --git a/Core/DISET/private/Service.py b/src/DIRAC/Core/DISET/private/Service.py similarity index 100% rename from Core/DISET/private/Service.py rename to src/DIRAC/Core/DISET/private/Service.py diff --git a/Core/DISET/private/ServiceConfiguration.py b/src/DIRAC/Core/DISET/private/ServiceConfiguration.py similarity index 100% rename from Core/DISET/private/ServiceConfiguration.py rename to src/DIRAC/Core/DISET/private/ServiceConfiguration.py diff --git a/Core/DISET/private/TransportPool.py b/src/DIRAC/Core/DISET/private/TransportPool.py similarity index 100% rename from Core/DISET/private/TransportPool.py rename to src/DIRAC/Core/DISET/private/TransportPool.py diff --git a/Core/DISET/private/Transports/BaseTransport.py b/src/DIRAC/Core/DISET/private/Transports/BaseTransport.py similarity index 100% rename from Core/DISET/private/Transports/BaseTransport.py rename to src/DIRAC/Core/DISET/private/Transports/BaseTransport.py diff --git a/Core/DISET/private/Transports/M2SSLTransport.py b/src/DIRAC/Core/DISET/private/Transports/M2SSLTransport.py similarity index 100% rename from Core/DISET/private/Transports/M2SSLTransport.py rename to src/DIRAC/Core/DISET/private/Transports/M2SSLTransport.py diff --git a/Core/DISET/private/Transports/PlainTransport.py b/src/DIRAC/Core/DISET/private/Transports/PlainTransport.py similarity index 100% rename from Core/DISET/private/Transports/PlainTransport.py rename to src/DIRAC/Core/DISET/private/Transports/PlainTransport.py diff --git a/Core/DISET/private/Transports/SSL/FakeSocket.py b/src/DIRAC/Core/DISET/private/Transports/SSL/FakeSocket.py similarity index 100% rename from Core/DISET/private/Transports/SSL/FakeSocket.py rename to src/DIRAC/Core/DISET/private/Transports/SSL/FakeSocket.py diff --git a/Core/DISET/private/Transports/SSL/M2Utils.py b/src/DIRAC/Core/DISET/private/Transports/SSL/M2Utils.py similarity index 100% rename from Core/DISET/private/Transports/SSL/M2Utils.py rename to src/DIRAC/Core/DISET/private/Transports/SSL/M2Utils.py diff --git a/Core/DISET/private/Transports/SSL/__init__.py b/src/DIRAC/Core/DISET/private/Transports/SSL/__init__.py similarity index 100% rename from Core/DISET/private/Transports/SSL/__init__.py rename to src/DIRAC/Core/DISET/private/Transports/SSL/__init__.py diff --git a/Core/DISET/private/Transports/SSLTransport.py b/src/DIRAC/Core/DISET/private/Transports/SSLTransport.py similarity index 100% rename from Core/DISET/private/Transports/SSLTransport.py rename to src/DIRAC/Core/DISET/private/Transports/SSLTransport.py diff --git a/Core/DISET/private/Transports/__init__.py b/src/DIRAC/Core/DISET/private/Transports/__init__.py similarity index 100% rename from Core/DISET/private/Transports/__init__.py rename to src/DIRAC/Core/DISET/private/Transports/__init__.py diff --git a/Core/DISET/private/Transports/test/Test_SSLTransport.py b/src/DIRAC/Core/DISET/private/Transports/test/Test_SSLTransport.py similarity index 100% rename from Core/DISET/private/Transports/test/Test_SSLTransport.py rename to src/DIRAC/Core/DISET/private/Transports/test/Test_SSLTransport.py diff --git a/Core/DISET/private/Transports/test/__init__.py b/src/DIRAC/Core/DISET/private/Transports/test/__init__.py similarity index 100% rename from Core/DISET/private/Transports/test/__init__.py rename to src/DIRAC/Core/DISET/private/Transports/test/__init__.py diff --git a/Core/DISET/private/Transports/test/proxy.pem b/src/DIRAC/Core/DISET/private/Transports/test/proxy.pem similarity index 100% rename from Core/DISET/private/Transports/test/proxy.pem rename to src/DIRAC/Core/DISET/private/Transports/test/proxy.pem diff --git a/Core/DISET/private/__init__.py b/src/DIRAC/Core/DISET/private/__init__.py similarity index 100% rename from Core/DISET/private/__init__.py rename to src/DIRAC/Core/DISET/private/__init__.py diff --git a/Core/DISET/test/Test_AuthManager.py b/src/DIRAC/Core/DISET/test/Test_AuthManager.py similarity index 100% rename from Core/DISET/test/Test_AuthManager.py rename to src/DIRAC/Core/DISET/test/Test_AuthManager.py diff --git a/Core/LCG/GGUSTicketsClient.py b/src/DIRAC/Core/LCG/GGUSTicketsClient.py similarity index 100% rename from Core/LCG/GGUSTicketsClient.py rename to src/DIRAC/Core/LCG/GGUSTicketsClient.py diff --git a/Core/LCG/GOCDBClient.py b/src/DIRAC/Core/LCG/GOCDBClient.py similarity index 100% rename from Core/LCG/GOCDBClient.py rename to src/DIRAC/Core/LCG/GOCDBClient.py diff --git a/Core/LCG/__init__.py b/src/DIRAC/Core/LCG/__init__.py similarity index 100% rename from Core/LCG/__init__.py rename to src/DIRAC/Core/LCG/__init__.py diff --git a/Core/LCG/test/Test_LCG.py b/src/DIRAC/Core/LCG/test/Test_LCG.py similarity index 100% rename from Core/LCG/test/Test_LCG.py rename to src/DIRAC/Core/LCG/test/Test_LCG.py diff --git a/Core/Security/BaseSecurity.py b/src/DIRAC/Core/Security/BaseSecurity.py similarity index 100% rename from Core/Security/BaseSecurity.py rename to src/DIRAC/Core/Security/BaseSecurity.py diff --git a/Core/Security/Locations.py b/src/DIRAC/Core/Security/Locations.py similarity index 100% rename from Core/Security/Locations.py rename to src/DIRAC/Core/Security/Locations.py diff --git a/Core/Security/MyProxy.py b/src/DIRAC/Core/Security/MyProxy.py similarity index 100% rename from Core/Security/MyProxy.py rename to src/DIRAC/Core/Security/MyProxy.py diff --git a/Core/Security/Properties.py b/src/DIRAC/Core/Security/Properties.py similarity index 100% rename from Core/Security/Properties.py rename to src/DIRAC/Core/Security/Properties.py diff --git a/Core/Security/ProxyFile.py b/src/DIRAC/Core/Security/ProxyFile.py similarity index 100% rename from Core/Security/ProxyFile.py rename to src/DIRAC/Core/Security/ProxyFile.py diff --git a/Core/Security/ProxyInfo.py b/src/DIRAC/Core/Security/ProxyInfo.py similarity index 100% rename from Core/Security/ProxyInfo.py rename to src/DIRAC/Core/Security/ProxyInfo.py diff --git a/Core/Security/Utilities.py b/src/DIRAC/Core/Security/Utilities.py similarity index 100% rename from Core/Security/Utilities.py rename to src/DIRAC/Core/Security/Utilities.py diff --git a/Core/Security/VOMS.py b/src/DIRAC/Core/Security/VOMS.py similarity index 100% rename from Core/Security/VOMS.py rename to src/DIRAC/Core/Security/VOMS.py diff --git a/Core/Security/VOMSService.py b/src/DIRAC/Core/Security/VOMSService.py similarity index 100% rename from Core/Security/VOMSService.py rename to src/DIRAC/Core/Security/VOMSService.py diff --git a/Core/Security/__init__.py b/src/DIRAC/Core/Security/__init__.py similarity index 100% rename from Core/Security/__init__.py rename to src/DIRAC/Core/Security/__init__.py diff --git a/Core/Security/m2crypto/X509CRL.py b/src/DIRAC/Core/Security/m2crypto/X509CRL.py similarity index 100% rename from Core/Security/m2crypto/X509CRL.py rename to src/DIRAC/Core/Security/m2crypto/X509CRL.py diff --git a/Core/Security/m2crypto/X509Certificate.py b/src/DIRAC/Core/Security/m2crypto/X509Certificate.py similarity index 100% rename from Core/Security/m2crypto/X509Certificate.py rename to src/DIRAC/Core/Security/m2crypto/X509Certificate.py diff --git a/Core/Security/m2crypto/X509Chain.py b/src/DIRAC/Core/Security/m2crypto/X509Chain.py similarity index 99% rename from Core/Security/m2crypto/X509Chain.py rename to src/DIRAC/Core/Security/m2crypto/X509Chain.py index 05b70651740..45a6f8948b0 100644 --- a/Core/Security/m2crypto/X509Chain.py +++ b/src/DIRAC/Core/Security/m2crypto/X509Chain.py @@ -895,7 +895,7 @@ def dumpChainToString(self): :returns: S_OK(pem chain) """ - data = '' + data = b"" for cert in self._certList: data += cert.asPem() return S_OK(data) @@ -1060,9 +1060,9 @@ def hash(self): return S_OK(self.__hash) sha1 = hashlib.sha1() for cert in self._certList: - sha1.update(str(cert.getSubjectNameObject()["Value"])) - sha1.update(str(self.getRemainingSecs()['Value'] / 3600)) - sha1.update(self.getDIRACGroup()['Value']) + sha1.update(str(cert.getSubjectNameObject()["Value"]).encode()) + sha1.update(str(self.getRemainingSecs()['Value'] / 3600).encode()) + sha1.update(self.getDIRACGroup()['Value'].encode()) if self.isVOMS(): sha1.update(b"VOMS") from DIRAC.Core.Security.VOMS import VOMS diff --git a/Core/Security/m2crypto/X509Request.py b/src/DIRAC/Core/Security/m2crypto/X509Request.py similarity index 100% rename from Core/Security/m2crypto/X509Request.py rename to src/DIRAC/Core/Security/m2crypto/X509Request.py diff --git a/Core/Security/m2crypto/__init__.py b/src/DIRAC/Core/Security/m2crypto/__init__.py similarity index 100% rename from Core/Security/m2crypto/__init__.py rename to src/DIRAC/Core/Security/m2crypto/__init__.py diff --git a/Core/Security/m2crypto/asn1_utils.py b/src/DIRAC/Core/Security/m2crypto/asn1_utils.py similarity index 100% rename from Core/Security/m2crypto/asn1_utils.py rename to src/DIRAC/Core/Security/m2crypto/asn1_utils.py diff --git a/Core/Security/test/Test_X509Certificate.py b/src/DIRAC/Core/Security/test/Test_X509Certificate.py similarity index 100% rename from Core/Security/test/Test_X509Certificate.py rename to src/DIRAC/Core/Security/test/Test_X509Certificate.py diff --git a/Core/Security/test/Test_X509Chain.py b/src/DIRAC/Core/Security/test/Test_X509Chain.py similarity index 99% rename from Core/Security/test/Test_X509Chain.py rename to src/DIRAC/Core/Security/test/Test_X509Chain.py index e887985064b..3a634b22920 100644 --- a/Core/Security/test/Test_X509Chain.py +++ b/src/DIRAC/Core/Security/test/Test_X509Chain.py @@ -60,7 +60,7 @@ def get_proxy(request): # When you do the delegation, you call both Request and Proxy generation fixtures. # So if you do the cleaning twice, you end up in a terrible mess. # So, do not do the cleaning if you are in the test_delegation method - if request.function.func_name != 'test_delegation': + if request.function.__name__ != 'test_delegation': deimportDIRAC() x509Class = request.param @@ -335,7 +335,7 @@ def test_dumpChainToString_on_cert(cert_file, get_X509Chain_class): assert res['OK'] - assert res['Value'] == "%s" % getCertOption(cert_file, 'content') + assert res['Value'] == getCertOption(cert_file, 'content') @parametrize('cert_file', CERTS) diff --git a/Core/Security/test/__init__.py b/src/DIRAC/Core/Security/test/__init__.py similarity index 100% rename from Core/Security/test/__init__.py rename to src/DIRAC/Core/Security/test/__init__.py diff --git a/Core/Security/test/certs/ca/b236481c.0 b/src/DIRAC/Core/Security/test/certs/ca/b236481c.0 similarity index 100% rename from Core/Security/test/certs/ca/b236481c.0 rename to src/DIRAC/Core/Security/test/certs/ca/b236481c.0 diff --git a/Core/Security/test/certs/ca/ca.cert.pem b/src/DIRAC/Core/Security/test/certs/ca/ca.cert.pem similarity index 100% rename from Core/Security/test/certs/ca/ca.cert.pem rename to src/DIRAC/Core/Security/test/certs/ca/ca.cert.pem diff --git a/Core/Security/test/certs/ca/ca.key.pem b/src/DIRAC/Core/Security/test/certs/ca/ca.key.pem similarity index 100% rename from Core/Security/test/certs/ca/ca.key.pem rename to src/DIRAC/Core/Security/test/certs/ca/ca.key.pem diff --git a/Core/Security/test/certs/ca/crlnumber b/src/DIRAC/Core/Security/test/certs/ca/crlnumber similarity index 100% rename from Core/Security/test/certs/ca/crlnumber rename to src/DIRAC/Core/Security/test/certs/ca/crlnumber diff --git a/Core/Security/test/certs/ca/index.txt b/src/DIRAC/Core/Security/test/certs/ca/index.txt similarity index 100% rename from Core/Security/test/certs/ca/index.txt rename to src/DIRAC/Core/Security/test/certs/ca/index.txt diff --git a/Core/Security/test/certs/ca/index.txt.attr b/src/DIRAC/Core/Security/test/certs/ca/index.txt.attr similarity index 100% rename from Core/Security/test/certs/ca/index.txt.attr rename to src/DIRAC/Core/Security/test/certs/ca/index.txt.attr diff --git a/Core/Security/test/certs/ca/index.txt.attr.old b/src/DIRAC/Core/Security/test/certs/ca/index.txt.attr.old similarity index 100% rename from Core/Security/test/certs/ca/index.txt.attr.old rename to src/DIRAC/Core/Security/test/certs/ca/index.txt.attr.old diff --git a/Core/Security/test/certs/ca/index.txt.old b/src/DIRAC/Core/Security/test/certs/ca/index.txt.old similarity index 100% rename from Core/Security/test/certs/ca/index.txt.old rename to src/DIRAC/Core/Security/test/certs/ca/index.txt.old diff --git a/Core/Security/test/certs/ca/newcerts/1000.pem b/src/DIRAC/Core/Security/test/certs/ca/newcerts/1000.pem similarity index 100% rename from Core/Security/test/certs/ca/newcerts/1000.pem rename to src/DIRAC/Core/Security/test/certs/ca/newcerts/1000.pem diff --git a/Core/Security/test/certs/ca/newcerts/1001.pem b/src/DIRAC/Core/Security/test/certs/ca/newcerts/1001.pem similarity index 100% rename from Core/Security/test/certs/ca/newcerts/1001.pem rename to src/DIRAC/Core/Security/test/certs/ca/newcerts/1001.pem diff --git a/Core/Security/test/certs/ca/newcerts/1002.pem b/src/DIRAC/Core/Security/test/certs/ca/newcerts/1002.pem similarity index 100% rename from Core/Security/test/certs/ca/newcerts/1002.pem rename to src/DIRAC/Core/Security/test/certs/ca/newcerts/1002.pem diff --git a/Core/Security/test/certs/ca/openssl_config_ca.cnf b/src/DIRAC/Core/Security/test/certs/ca/openssl_config_ca.cnf similarity index 100% rename from Core/Security/test/certs/ca/openssl_config_ca.cnf rename to src/DIRAC/Core/Security/test/certs/ca/openssl_config_ca.cnf diff --git a/Core/Security/test/certs/ca/serial b/src/DIRAC/Core/Security/test/certs/ca/serial similarity index 100% rename from Core/Security/test/certs/ca/serial rename to src/DIRAC/Core/Security/test/certs/ca/serial diff --git a/Core/Security/test/certs/ca/serial.old b/src/DIRAC/Core/Security/test/certs/ca/serial.old similarity index 100% rename from Core/Security/test/certs/ca/serial.old rename to src/DIRAC/Core/Security/test/certs/ca/serial.old diff --git a/Core/Security/test/certs/host/hostcert.pem b/src/DIRAC/Core/Security/test/certs/host/hostcert.pem similarity index 100% rename from Core/Security/test/certs/host/hostcert.pem rename to src/DIRAC/Core/Security/test/certs/host/hostcert.pem diff --git a/Core/Security/test/certs/host/hostkey.pem b/src/DIRAC/Core/Security/test/certs/host/hostkey.pem similarity index 100% rename from Core/Security/test/certs/host/hostkey.pem rename to src/DIRAC/Core/Security/test/certs/host/hostkey.pem diff --git a/Core/Security/test/certs/host/hostkey.pem.bak b/src/DIRAC/Core/Security/test/certs/host/hostkey.pem.bak similarity index 100% rename from Core/Security/test/certs/host/hostkey.pem.bak rename to src/DIRAC/Core/Security/test/certs/host/hostkey.pem.bak diff --git a/Core/Security/test/certs/host/openssl_config_host.cnf b/src/DIRAC/Core/Security/test/certs/host/openssl_config_host.cnf similarity index 100% rename from Core/Security/test/certs/host/openssl_config_host.cnf rename to src/DIRAC/Core/Security/test/certs/host/openssl_config_host.cnf diff --git a/Core/Security/test/certs/host/request.csr.pem b/src/DIRAC/Core/Security/test/certs/host/request.csr.pem similarity index 100% rename from Core/Security/test/certs/host/request.csr.pem rename to src/DIRAC/Core/Security/test/certs/host/request.csr.pem diff --git a/Core/Security/test/certs/key/encrypted_key_pass_0000.pem b/src/DIRAC/Core/Security/test/certs/key/encrypted_key_pass_0000.pem similarity index 100% rename from Core/Security/test/certs/key/encrypted_key_pass_0000.pem rename to src/DIRAC/Core/Security/test/certs/key/encrypted_key_pass_0000.pem diff --git a/Core/Security/test/certs/user/openssl_config_user.cnf b/src/DIRAC/Core/Security/test/certs/user/openssl_config_user.cnf similarity index 100% rename from Core/Security/test/certs/user/openssl_config_user.cnf rename to src/DIRAC/Core/Security/test/certs/user/openssl_config_user.cnf diff --git a/Core/Security/test/certs/user/request.csr.pem b/src/DIRAC/Core/Security/test/certs/user/request.csr.pem similarity index 100% rename from Core/Security/test/certs/user/request.csr.pem rename to src/DIRAC/Core/Security/test/certs/user/request.csr.pem diff --git a/Core/Security/test/certs/user/usercert.pem b/src/DIRAC/Core/Security/test/certs/user/usercert.pem similarity index 100% rename from Core/Security/test/certs/user/usercert.pem rename to src/DIRAC/Core/Security/test/certs/user/usercert.pem diff --git a/Core/Security/test/certs/user/userkey.pem b/src/DIRAC/Core/Security/test/certs/user/userkey.pem similarity index 100% rename from Core/Security/test/certs/user/userkey.pem rename to src/DIRAC/Core/Security/test/certs/user/userkey.pem diff --git a/Core/Security/test/certs/voms/README b/src/DIRAC/Core/Security/test/certs/voms/README similarity index 100% rename from Core/Security/test/certs/voms/README rename to src/DIRAC/Core/Security/test/certs/voms/README diff --git a/Core/Security/test/certs/voms/proxy.pem b/src/DIRAC/Core/Security/test/certs/voms/proxy.pem similarity index 100% rename from Core/Security/test/certs/voms/proxy.pem rename to src/DIRAC/Core/Security/test/certs/voms/proxy.pem diff --git a/Core/Security/test/test_X509Request.py b/src/DIRAC/Core/Security/test/test_X509Request.py similarity index 100% rename from Core/Security/test/test_X509Request.py rename to src/DIRAC/Core/Security/test/test_X509Request.py diff --git a/Core/Security/test/x509TestUtilities.py b/src/DIRAC/Core/Security/test/x509TestUtilities.py similarity index 98% rename from Core/Security/test/x509TestUtilities.py rename to src/DIRAC/Core/Security/test/x509TestUtilities.py index 5e44030c6f4..f7ecf292dfa 100644 --- a/Core/Security/test/x509TestUtilities.py +++ b/src/DIRAC/Core/Security/test/x509TestUtilities.py @@ -23,7 +23,7 @@ CERTKEYS = (HOSTKEY, USERKEY) CERTCONTENTS = { - 'HOSTCERTCONTENT': """-----BEGIN CERTIFICATE----- + 'HOSTCERTCONTENT': b"""-----BEGIN CERTIFICATE----- MIIGQTCCBCmgAwIBAgICEAIwDQYJKoZIhvcNAQELBQAwVDEYMBYGA1UECgwPRElS QUMgQ29tcHV0aW5nMTgwNgYDVQQDDC9ESVJBQyBDb21wdXRpbmcgU2lnbmluZyBD ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0xODA4MjIwOTE4MTdaFw0zNzEwMjEw @@ -60,7 +60,7 @@ Hia1xkpBKOPRY0BrSGCdEUT5+ict -----END CERTIFICATE----- """, - 'USERCERTCONTENT': """-----BEGIN CERTIFICATE----- + 'USERCERTCONTENT': b"""-----BEGIN CERTIFICATE----- MIIFszCCA5ugAwIBAgICEAEwDQYJKoZIhvcNAQELBQAwVDEYMBYGA1UECgwPRElS QUMgQ29tcHV0aW5nMTgwNgYDVQQDDC9ESVJBQyBDb21wdXRpbmcgU2lnbmluZyBD ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0xODA4MjIwOTE1MTRaFw0zNzEwMjEw @@ -105,7 +105,7 @@ # https://tls.mbed.org/kb/cryptography/asn1-key-structures-in-der-and-pem KEYCONTENTS_PKCS8 = { - HOSTKEY: """-----BEGIN PRIVATE KEY----- + HOSTKEY: b"""-----BEGIN PRIVATE KEY----- MIIJQwIBADANBgkqhkiG9w0BAQEFAASCCS0wggkpAgEAAoICAQDjV5Y6AQI61nZH y6hjr1MziFFeh/z1DdAgkPfiUnHQLxWtvXGcc4sX/tBcD6tvNKTzJCwyFVAML0WN TD/w480TUmGILlRtg+17qfSWfeCvDygSbGNINX+la0auEqY7u5oXtwhFAEnqBe+6 @@ -158,7 +158,7 @@ CrerHYr0zdgIXTt+xus9RGGmZi1mfjI= -----END PRIVATE KEY----- """, - USERKEY: """-----BEGIN PRIVATE KEY----- + USERKEY: b"""-----BEGIN PRIVATE KEY----- MIIJQgIBADANBgkqhkiG9w0BAQEFAASCCSwwggkoAgEAAoICAQCp9md/3Ar5r6rH yR9GUhp6HMPaLH7pMpkn7D1oGWHXVvlw9+Ygw6ZMRd7ysPkbpYqh84o0GJDi9fa0 S/umxil60zBD1HmSzrtE39gYWTMQQ7uPNgW1axLaNux0dV//bB6MgI+EAFg/WwZp diff --git a/Core/Tornado/Client/ClientSelector.py b/src/DIRAC/Core/Tornado/Client/ClientSelector.py similarity index 100% rename from Core/Tornado/Client/ClientSelector.py rename to src/DIRAC/Core/Tornado/Client/ClientSelector.py diff --git a/Core/Tornado/Client/TornadoClient.py b/src/DIRAC/Core/Tornado/Client/TornadoClient.py similarity index 100% rename from Core/Tornado/Client/TornadoClient.py rename to src/DIRAC/Core/Tornado/Client/TornadoClient.py diff --git a/Core/Tornado/Client/__init__.py b/src/DIRAC/Core/Tornado/Client/__init__.py similarity index 100% rename from Core/Tornado/Client/__init__.py rename to src/DIRAC/Core/Tornado/Client/__init__.py diff --git a/Core/Tornado/Client/private/TornadoBaseClient.py b/src/DIRAC/Core/Tornado/Client/private/TornadoBaseClient.py similarity index 100% rename from Core/Tornado/Client/private/TornadoBaseClient.py rename to src/DIRAC/Core/Tornado/Client/private/TornadoBaseClient.py diff --git a/Core/Tornado/Client/private/__init__.py b/src/DIRAC/Core/Tornado/Client/private/__init__.py similarity index 100% rename from Core/Tornado/Client/private/__init__.py rename to src/DIRAC/Core/Tornado/Client/private/__init__.py diff --git a/Core/Tornado/Server/HandlerManager.py b/src/DIRAC/Core/Tornado/Server/HandlerManager.py similarity index 100% rename from Core/Tornado/Server/HandlerManager.py rename to src/DIRAC/Core/Tornado/Server/HandlerManager.py diff --git a/Core/Tornado/Server/TornadoServer.py b/src/DIRAC/Core/Tornado/Server/TornadoServer.py similarity index 100% rename from Core/Tornado/Server/TornadoServer.py rename to src/DIRAC/Core/Tornado/Server/TornadoServer.py diff --git a/Core/Tornado/Server/TornadoService.py b/src/DIRAC/Core/Tornado/Server/TornadoService.py similarity index 100% rename from Core/Tornado/Server/TornadoService.py rename to src/DIRAC/Core/Tornado/Server/TornadoService.py diff --git a/Core/Tornado/Server/__init__.py b/src/DIRAC/Core/Tornado/Server/__init__.py similarity index 100% rename from Core/Tornado/Server/__init__.py rename to src/DIRAC/Core/Tornado/Server/__init__.py diff --git a/Core/Tornado/__init__.py b/src/DIRAC/Core/Tornado/__init__.py similarity index 100% rename from Core/Tornado/__init__.py rename to src/DIRAC/Core/Tornado/__init__.py diff --git a/Core/Tornado/scripts/__init__.py b/src/DIRAC/Core/Tornado/scripts/__init__.py similarity index 100% rename from Core/Tornado/scripts/__init__.py rename to src/DIRAC/Core/Tornado/scripts/__init__.py diff --git a/Core/Tornado/scripts/tornado-start-CS.py b/src/DIRAC/Core/Tornado/scripts/tornado-start-CS.py similarity index 100% rename from Core/Tornado/scripts/tornado-start-CS.py rename to src/DIRAC/Core/Tornado/scripts/tornado-start-CS.py diff --git a/Core/Tornado/scripts/tornado-start-all.py b/src/DIRAC/Core/Tornado/scripts/tornado-start-all.py similarity index 100% rename from Core/Tornado/scripts/tornado-start-all.py rename to src/DIRAC/Core/Tornado/scripts/tornado-start-all.py diff --git a/Core/Utilities/Adler.py b/src/DIRAC/Core/Utilities/Adler.py similarity index 100% rename from Core/Utilities/Adler.py rename to src/DIRAC/Core/Utilities/Adler.py diff --git a/Core/Utilities/ClassAd/ClassAdLight.py b/src/DIRAC/Core/Utilities/ClassAd/ClassAdLight.py similarity index 100% rename from Core/Utilities/ClassAd/ClassAdLight.py rename to src/DIRAC/Core/Utilities/ClassAd/ClassAdLight.py diff --git a/Core/Utilities/ClassAd/__init__.py b/src/DIRAC/Core/Utilities/ClassAd/__init__.py similarity index 100% rename from Core/Utilities/ClassAd/__init__.py rename to src/DIRAC/Core/Utilities/ClassAd/__init__.py diff --git a/Core/Utilities/CountryMapping.py b/src/DIRAC/Core/Utilities/CountryMapping.py similarity index 100% rename from Core/Utilities/CountryMapping.py rename to src/DIRAC/Core/Utilities/CountryMapping.py diff --git a/Core/Utilities/DAG.py b/src/DIRAC/Core/Utilities/DAG.py similarity index 100% rename from Core/Utilities/DAG.py rename to src/DIRAC/Core/Utilities/DAG.py diff --git a/Core/Utilities/DEncode.py b/src/DIRAC/Core/Utilities/DEncode.py similarity index 100% rename from Core/Utilities/DEncode.py rename to src/DIRAC/Core/Utilities/DEncode.py diff --git a/Core/Utilities/DErrno.py b/src/DIRAC/Core/Utilities/DErrno.py similarity index 100% rename from Core/Utilities/DErrno.py rename to src/DIRAC/Core/Utilities/DErrno.py diff --git a/Core/Utilities/DIRACSingleton.py b/src/DIRAC/Core/Utilities/DIRACSingleton.py similarity index 100% rename from Core/Utilities/DIRACSingleton.py rename to src/DIRAC/Core/Utilities/DIRACSingleton.py diff --git a/Core/Utilities/Decorators.py b/src/DIRAC/Core/Utilities/Decorators.py similarity index 100% rename from Core/Utilities/Decorators.py rename to src/DIRAC/Core/Utilities/Decorators.py diff --git a/Core/Utilities/Devloader.py b/src/DIRAC/Core/Utilities/Devloader.py similarity index 100% rename from Core/Utilities/Devloader.py rename to src/DIRAC/Core/Utilities/Devloader.py diff --git a/Core/Utilities/DictCache.py b/src/DIRAC/Core/Utilities/DictCache.py similarity index 100% rename from Core/Utilities/DictCache.py rename to src/DIRAC/Core/Utilities/DictCache.py diff --git a/Core/Utilities/Dictionaries.py b/src/DIRAC/Core/Utilities/Dictionaries.py similarity index 100% rename from Core/Utilities/Dictionaries.py rename to src/DIRAC/Core/Utilities/Dictionaries.py diff --git a/Core/Utilities/DirectoryExplorer.py b/src/DIRAC/Core/Utilities/DirectoryExplorer.py similarity index 100% rename from Core/Utilities/DirectoryExplorer.py rename to src/DIRAC/Core/Utilities/DirectoryExplorer.py diff --git a/Core/Utilities/ElasticSearchDB.py b/src/DIRAC/Core/Utilities/ElasticSearchDB.py similarity index 100% rename from Core/Utilities/ElasticSearchDB.py rename to src/DIRAC/Core/Utilities/ElasticSearchDB.py diff --git a/Core/Utilities/EventDispatcher.py b/src/DIRAC/Core/Utilities/EventDispatcher.py similarity index 100% rename from Core/Utilities/EventDispatcher.py rename to src/DIRAC/Core/Utilities/EventDispatcher.py diff --git a/Core/Utilities/ExecutorDispatcher.py b/src/DIRAC/Core/Utilities/ExecutorDispatcher.py similarity index 100% rename from Core/Utilities/ExecutorDispatcher.py rename to src/DIRAC/Core/Utilities/ExecutorDispatcher.py diff --git a/Core/Utilities/ExitCallback.py b/src/DIRAC/Core/Utilities/ExitCallback.py similarity index 100% rename from Core/Utilities/ExitCallback.py rename to src/DIRAC/Core/Utilities/ExitCallback.py diff --git a/Core/Utilities/File.py b/src/DIRAC/Core/Utilities/File.py similarity index 100% rename from Core/Utilities/File.py rename to src/DIRAC/Core/Utilities/File.py diff --git a/Core/Utilities/Glue2.py b/src/DIRAC/Core/Utilities/Glue2.py similarity index 100% rename from Core/Utilities/Glue2.py rename to src/DIRAC/Core/Utilities/Glue2.py diff --git a/Core/Utilities/Graph.py b/src/DIRAC/Core/Utilities/Graph.py similarity index 100% rename from Core/Utilities/Graph.py rename to src/DIRAC/Core/Utilities/Graph.py diff --git a/Core/Utilities/Graphs/BarGraph.py b/src/DIRAC/Core/Utilities/Graphs/BarGraph.py similarity index 100% rename from Core/Utilities/Graphs/BarGraph.py rename to src/DIRAC/Core/Utilities/Graphs/BarGraph.py diff --git a/Core/Utilities/Graphs/CurveGraph.py b/src/DIRAC/Core/Utilities/Graphs/CurveGraph.py similarity index 100% rename from Core/Utilities/Graphs/CurveGraph.py rename to src/DIRAC/Core/Utilities/Graphs/CurveGraph.py diff --git a/Core/Utilities/Graphs/Dwatermark.png b/src/DIRAC/Core/Utilities/Graphs/Dwatermark.png similarity index 100% rename from Core/Utilities/Graphs/Dwatermark.png rename to src/DIRAC/Core/Utilities/Graphs/Dwatermark.png diff --git a/Core/Utilities/Graphs/Graph.py b/src/DIRAC/Core/Utilities/Graphs/Graph.py similarity index 100% rename from Core/Utilities/Graphs/Graph.py rename to src/DIRAC/Core/Utilities/Graphs/Graph.py diff --git a/Core/Utilities/Graphs/GraphData.py b/src/DIRAC/Core/Utilities/Graphs/GraphData.py similarity index 100% rename from Core/Utilities/Graphs/GraphData.py rename to src/DIRAC/Core/Utilities/Graphs/GraphData.py diff --git a/Core/Utilities/Graphs/GraphUtilities.py b/src/DIRAC/Core/Utilities/Graphs/GraphUtilities.py similarity index 100% rename from Core/Utilities/Graphs/GraphUtilities.py rename to src/DIRAC/Core/Utilities/Graphs/GraphUtilities.py diff --git a/Core/Utilities/Graphs/Legend.py b/src/DIRAC/Core/Utilities/Graphs/Legend.py similarity index 100% rename from Core/Utilities/Graphs/Legend.py rename to src/DIRAC/Core/Utilities/Graphs/Legend.py diff --git a/Core/Utilities/Graphs/LineGraph.py b/src/DIRAC/Core/Utilities/Graphs/LineGraph.py similarity index 100% rename from Core/Utilities/Graphs/LineGraph.py rename to src/DIRAC/Core/Utilities/Graphs/LineGraph.py diff --git a/Core/Utilities/Graphs/Palette.py b/src/DIRAC/Core/Utilities/Graphs/Palette.py similarity index 100% rename from Core/Utilities/Graphs/Palette.py rename to src/DIRAC/Core/Utilities/Graphs/Palette.py diff --git a/Core/Utilities/Graphs/PieGraph.py b/src/DIRAC/Core/Utilities/Graphs/PieGraph.py similarity index 100% rename from Core/Utilities/Graphs/PieGraph.py rename to src/DIRAC/Core/Utilities/Graphs/PieGraph.py diff --git a/Core/Utilities/Graphs/PlotBase.py b/src/DIRAC/Core/Utilities/Graphs/PlotBase.py similarity index 100% rename from Core/Utilities/Graphs/PlotBase.py rename to src/DIRAC/Core/Utilities/Graphs/PlotBase.py diff --git a/Core/Utilities/Graphs/QualityMapGraph.py b/src/DIRAC/Core/Utilities/Graphs/QualityMapGraph.py similarity index 100% rename from Core/Utilities/Graphs/QualityMapGraph.py rename to src/DIRAC/Core/Utilities/Graphs/QualityMapGraph.py diff --git a/Core/Utilities/Graphs/__init__.py b/src/DIRAC/Core/Utilities/Graphs/__init__.py similarity index 100% rename from Core/Utilities/Graphs/__init__.py rename to src/DIRAC/Core/Utilities/Graphs/__init__.py diff --git a/Core/Utilities/Grid.py b/src/DIRAC/Core/Utilities/Grid.py similarity index 100% rename from Core/Utilities/Grid.py rename to src/DIRAC/Core/Utilities/Grid.py diff --git a/Core/Utilities/JDL.py b/src/DIRAC/Core/Utilities/JDL.py similarity index 100% rename from Core/Utilities/JDL.py rename to src/DIRAC/Core/Utilities/JDL.py diff --git a/Core/Utilities/JEncode.py b/src/DIRAC/Core/Utilities/JEncode.py similarity index 100% rename from Core/Utilities/JEncode.py rename to src/DIRAC/Core/Utilities/JEncode.py diff --git a/Core/Utilities/List.py b/src/DIRAC/Core/Utilities/List.py similarity index 100% rename from Core/Utilities/List.py rename to src/DIRAC/Core/Utilities/List.py diff --git a/Core/Utilities/LockRing.py b/src/DIRAC/Core/Utilities/LockRing.py similarity index 100% rename from Core/Utilities/LockRing.py rename to src/DIRAC/Core/Utilities/LockRing.py diff --git a/Core/Utilities/MJF.py b/src/DIRAC/Core/Utilities/MJF.py similarity index 100% rename from Core/Utilities/MJF.py rename to src/DIRAC/Core/Utilities/MJF.py diff --git a/Core/Utilities/Mail.py b/src/DIRAC/Core/Utilities/Mail.py similarity index 100% rename from Core/Utilities/Mail.py rename to src/DIRAC/Core/Utilities/Mail.py diff --git a/Core/Utilities/MemStat.py b/src/DIRAC/Core/Utilities/MemStat.py similarity index 100% rename from Core/Utilities/MemStat.py rename to src/DIRAC/Core/Utilities/MemStat.py diff --git a/Core/Utilities/MixedEncode.py b/src/DIRAC/Core/Utilities/MixedEncode.py similarity index 100% rename from Core/Utilities/MixedEncode.py rename to src/DIRAC/Core/Utilities/MixedEncode.py diff --git a/Core/Utilities/ModuleFactory.py b/src/DIRAC/Core/Utilities/ModuleFactory.py similarity index 100% rename from Core/Utilities/ModuleFactory.py rename to src/DIRAC/Core/Utilities/ModuleFactory.py diff --git a/Core/Utilities/MySQL.py b/src/DIRAC/Core/Utilities/MySQL.py similarity index 100% rename from Core/Utilities/MySQL.py rename to src/DIRAC/Core/Utilities/MySQL.py diff --git a/Core/Utilities/NTP.py b/src/DIRAC/Core/Utilities/NTP.py similarity index 100% rename from Core/Utilities/NTP.py rename to src/DIRAC/Core/Utilities/NTP.py diff --git a/Core/Utilities/Network.py b/src/DIRAC/Core/Utilities/Network.py similarity index 100% rename from Core/Utilities/Network.py rename to src/DIRAC/Core/Utilities/Network.py diff --git a/Core/Utilities/ObjectLoader.py b/src/DIRAC/Core/Utilities/ObjectLoader.py similarity index 100% rename from Core/Utilities/ObjectLoader.py rename to src/DIRAC/Core/Utilities/ObjectLoader.py diff --git a/Core/Utilities/Os.py b/src/DIRAC/Core/Utilities/Os.py similarity index 100% rename from Core/Utilities/Os.py rename to src/DIRAC/Core/Utilities/Os.py diff --git a/Core/Utilities/Pfn.py b/src/DIRAC/Core/Utilities/Pfn.py similarity index 100% rename from Core/Utilities/Pfn.py rename to src/DIRAC/Core/Utilities/Pfn.py diff --git a/Core/Utilities/Platform.py b/src/DIRAC/Core/Utilities/Platform.py similarity index 100% rename from Core/Utilities/Platform.py rename to src/DIRAC/Core/Utilities/Platform.py diff --git a/Core/Utilities/Plotting/DataCache.py b/src/DIRAC/Core/Utilities/Plotting/DataCache.py similarity index 100% rename from Core/Utilities/Plotting/DataCache.py rename to src/DIRAC/Core/Utilities/Plotting/DataCache.py diff --git a/Core/Utilities/Plotting/FileCoding.py b/src/DIRAC/Core/Utilities/Plotting/FileCoding.py similarity index 100% rename from Core/Utilities/Plotting/FileCoding.py rename to src/DIRAC/Core/Utilities/Plotting/FileCoding.py diff --git a/Core/Utilities/Plotting/ObjectLoader.py b/src/DIRAC/Core/Utilities/Plotting/ObjectLoader.py similarity index 100% rename from Core/Utilities/Plotting/ObjectLoader.py rename to src/DIRAC/Core/Utilities/Plotting/ObjectLoader.py diff --git a/Core/Utilities/Plotting/Plots.py b/src/DIRAC/Core/Utilities/Plotting/Plots.py similarity index 100% rename from Core/Utilities/Plotting/Plots.py rename to src/DIRAC/Core/Utilities/Plotting/Plots.py diff --git a/Core/Utilities/Plotting/TypeLoader.py b/src/DIRAC/Core/Utilities/Plotting/TypeLoader.py similarity index 100% rename from Core/Utilities/Plotting/TypeLoader.py rename to src/DIRAC/Core/Utilities/Plotting/TypeLoader.py diff --git a/Core/Utilities/Plotting/__init__.py b/src/DIRAC/Core/Utilities/Plotting/__init__.py similarity index 100% rename from Core/Utilities/Plotting/__init__.py rename to src/DIRAC/Core/Utilities/Plotting/__init__.py diff --git a/Core/Utilities/PrettyPrint.py b/src/DIRAC/Core/Utilities/PrettyPrint.py similarity index 100% rename from Core/Utilities/PrettyPrint.py rename to src/DIRAC/Core/Utilities/PrettyPrint.py diff --git a/Core/Utilities/ProcessPool.py b/src/DIRAC/Core/Utilities/ProcessPool.py similarity index 100% rename from Core/Utilities/ProcessPool.py rename to src/DIRAC/Core/Utilities/ProcessPool.py diff --git a/Core/Utilities/Profiler.py b/src/DIRAC/Core/Utilities/Profiler.py similarity index 100% rename from Core/Utilities/Profiler.py rename to src/DIRAC/Core/Utilities/Profiler.py diff --git a/Core/Utilities/PromptUser.py b/src/DIRAC/Core/Utilities/PromptUser.py similarity index 100% rename from Core/Utilities/PromptUser.py rename to src/DIRAC/Core/Utilities/PromptUser.py diff --git a/Core/Utilities/Proxy.py b/src/DIRAC/Core/Utilities/Proxy.py similarity index 100% rename from Core/Utilities/Proxy.py rename to src/DIRAC/Core/Utilities/Proxy.py diff --git a/Core/Utilities/RabbitMQAdmin.py b/src/DIRAC/Core/Utilities/RabbitMQAdmin.py similarity index 100% rename from Core/Utilities/RabbitMQAdmin.py rename to src/DIRAC/Core/Utilities/RabbitMQAdmin.py diff --git a/Core/Utilities/ReturnValues.py b/src/DIRAC/Core/Utilities/ReturnValues.py similarity index 100% rename from Core/Utilities/ReturnValues.py rename to src/DIRAC/Core/Utilities/ReturnValues.py diff --git a/Core/Utilities/Shifter.py b/src/DIRAC/Core/Utilities/Shifter.py similarity index 100% rename from Core/Utilities/Shifter.py rename to src/DIRAC/Core/Utilities/Shifter.py diff --git a/Core/Utilities/SiteSEMapping.py b/src/DIRAC/Core/Utilities/SiteSEMapping.py similarity index 100% rename from Core/Utilities/SiteSEMapping.py rename to src/DIRAC/Core/Utilities/SiteSEMapping.py diff --git a/Core/Utilities/StateMachine.py b/src/DIRAC/Core/Utilities/StateMachine.py similarity index 100% rename from Core/Utilities/StateMachine.py rename to src/DIRAC/Core/Utilities/StateMachine.py diff --git a/Core/Utilities/Subprocess.py b/src/DIRAC/Core/Utilities/Subprocess.py similarity index 100% rename from Core/Utilities/Subprocess.py rename to src/DIRAC/Core/Utilities/Subprocess.py diff --git a/Core/Utilities/ThreadPool.py b/src/DIRAC/Core/Utilities/ThreadPool.py similarity index 100% rename from Core/Utilities/ThreadPool.py rename to src/DIRAC/Core/Utilities/ThreadPool.py diff --git a/Core/Utilities/ThreadSafe.py b/src/DIRAC/Core/Utilities/ThreadSafe.py similarity index 100% rename from Core/Utilities/ThreadSafe.py rename to src/DIRAC/Core/Utilities/ThreadSafe.py diff --git a/Core/Utilities/ThreadScheduler.py b/src/DIRAC/Core/Utilities/ThreadScheduler.py similarity index 100% rename from Core/Utilities/ThreadScheduler.py rename to src/DIRAC/Core/Utilities/ThreadScheduler.py diff --git a/Core/Utilities/Time.py b/src/DIRAC/Core/Utilities/Time.py similarity index 100% rename from Core/Utilities/Time.py rename to src/DIRAC/Core/Utilities/Time.py diff --git a/Core/Utilities/Version.py b/src/DIRAC/Core/Utilities/Version.py similarity index 100% rename from Core/Utilities/Version.py rename to src/DIRAC/Core/Utilities/Version.py diff --git a/Core/Utilities/__init__.py b/src/DIRAC/Core/Utilities/__init__.py similarity index 100% rename from Core/Utilities/__init__.py rename to src/DIRAC/Core/Utilities/__init__.py diff --git a/Core/Utilities/test/ProcessesCreator.py b/src/DIRAC/Core/Utilities/test/ProcessesCreator.py similarity index 100% rename from Core/Utilities/test/ProcessesCreator.py rename to src/DIRAC/Core/Utilities/test/ProcessesCreator.py diff --git a/Core/Utilities/test/Test_Adler.py b/src/DIRAC/Core/Utilities/test/Test_Adler.py similarity index 100% rename from Core/Utilities/test/Test_Adler.py rename to src/DIRAC/Core/Utilities/test/Test_Adler.py diff --git a/Core/Utilities/test/Test_DAG.py b/src/DIRAC/Core/Utilities/test/Test_DAG.py similarity index 100% rename from Core/Utilities/test/Test_DAG.py rename to src/DIRAC/Core/Utilities/test/Test_DAG.py diff --git a/Core/Utilities/test/Test_Decorator.py b/src/DIRAC/Core/Utilities/test/Test_Decorator.py similarity index 100% rename from Core/Utilities/test/Test_Decorator.py rename to src/DIRAC/Core/Utilities/test/Test_Decorator.py diff --git a/Core/Utilities/test/Test_Dictionaries.py b/src/DIRAC/Core/Utilities/test/Test_Dictionaries.py similarity index 100% rename from Core/Utilities/test/Test_Dictionaries.py rename to src/DIRAC/Core/Utilities/test/Test_Dictionaries.py diff --git a/Core/Utilities/test/Test_Encode.py b/src/DIRAC/Core/Utilities/test/Test_Encode.py similarity index 99% rename from Core/Utilities/test/Test_Encode.py rename to src/DIRAC/Core/Utilities/test/Test_Encode.py index dbf4538651d..c815a7e521f 100644 --- a/Core/Utilities/test/Test_Encode.py +++ b/src/DIRAC/Core/Utilities/test/Test_Encode.py @@ -97,11 +97,9 @@ def test_everyBaseTypeIsTested(): We rely on the fact that the test function will be called "test_BaseType" """ - current_module = sys.modules[__name__] - for encodeFunc in g_dEncodeFunctions.values(): testFuncName = ('test_BaseType_%s' % encodeFunc.__name__).replace('encode', '') - getattr(current_module, testFuncName) + globals()[testFuncName] def agnosticTestFunction(enc_dec_tuple, data): diff --git a/Core/Utilities/test/Test_ExecutorDispatcher.py b/src/DIRAC/Core/Utilities/test/Test_ExecutorDispatcher.py similarity index 100% rename from Core/Utilities/test/Test_ExecutorDispatcher.py rename to src/DIRAC/Core/Utilities/test/Test_ExecutorDispatcher.py diff --git a/Core/Utilities/test/Test_File.py b/src/DIRAC/Core/Utilities/test/Test_File.py similarity index 100% rename from Core/Utilities/test/Test_File.py rename to src/DIRAC/Core/Utilities/test/Test_File.py diff --git a/Core/Utilities/test/Test_Graph.py b/src/DIRAC/Core/Utilities/test/Test_Graph.py similarity index 100% rename from Core/Utilities/test/Test_Graph.py rename to src/DIRAC/Core/Utilities/test/Test_Graph.py diff --git a/Core/Utilities/test/Test_List.py b/src/DIRAC/Core/Utilities/test/Test_List.py similarity index 100% rename from Core/Utilities/test/Test_List.py rename to src/DIRAC/Core/Utilities/test/Test_List.py diff --git a/Core/Utilities/test/Test_Mail.py b/src/DIRAC/Core/Utilities/test/Test_Mail.py similarity index 100% rename from Core/Utilities/test/Test_Mail.py rename to src/DIRAC/Core/Utilities/test/Test_Mail.py diff --git a/Core/Utilities/test/Test_ObjectLoader.py b/src/DIRAC/Core/Utilities/test/Test_ObjectLoader.py similarity index 100% rename from Core/Utilities/test/Test_ObjectLoader.py rename to src/DIRAC/Core/Utilities/test/Test_ObjectLoader.py diff --git a/Core/Utilities/test/Test_Pfn.py b/src/DIRAC/Core/Utilities/test/Test_Pfn.py similarity index 100% rename from Core/Utilities/test/Test_Pfn.py rename to src/DIRAC/Core/Utilities/test/Test_Pfn.py diff --git a/Core/Utilities/test/Test_ProcessPool.py b/src/DIRAC/Core/Utilities/test/Test_ProcessPool.py similarity index 100% rename from Core/Utilities/test/Test_ProcessPool.py rename to src/DIRAC/Core/Utilities/test/Test_ProcessPool.py diff --git a/Core/Utilities/test/Test_Profiler.py b/src/DIRAC/Core/Utilities/test/Test_Profiler.py similarity index 91% rename from Core/Utilities/test/Test_Profiler.py rename to src/DIRAC/Core/Utilities/test/Test_Profiler.py index 99ef9bacd2c..eed48088db1 100644 --- a/Core/Utilities/test/Test_Profiler.py +++ b/src/DIRAC/Core/Utilities/test/Test_Profiler.py @@ -6,10 +6,12 @@ from __future__ import print_function import time +from os.path import dirname, join from subprocess import Popen from flaky import flaky +import DIRAC from DIRAC.Core.Utilities.Profiler import Profiler @@ -20,7 +22,10 @@ def test_base(): res = p.status() assert res['OK'] is False - mainProcess = Popen(['python', 'tests/Utilities/ProcessesCreator_withChildren.py']) + mainProcess = Popen([ + 'python', + join(dirname(DIRAC.__file__), 'tests/Utilities/ProcessesCreator_withChildren.py'), + ]) time.sleep(1) p = Profiler(mainProcess.pid) res = p.pid() @@ -74,7 +79,10 @@ def test_base(): @flaky(max_runs=10, min_passes=2) def test_cpuUsage(): - mainProcess = Popen(['python', 'tests/Utilities/ProcessesCreator_withChildren.py']) + mainProcess = Popen([ + 'python', + join(dirname(DIRAC.__file__), 'tests/Utilities/ProcessesCreator_withChildren.py'), + ]) time.sleep(2) p = Profiler(mainProcess.pid) res = p.pid() diff --git a/Core/Utilities/test/Test_StateMachine.py b/src/DIRAC/Core/Utilities/test/Test_StateMachine.py similarity index 100% rename from Core/Utilities/test/Test_StateMachine.py rename to src/DIRAC/Core/Utilities/test/Test_StateMachine.py diff --git a/Core/Utilities/test/Test_Subprocess.py b/src/DIRAC/Core/Utilities/test/Test_Subprocess.py similarity index 92% rename from Core/Utilities/test/Test_Subprocess.py rename to src/DIRAC/Core/Utilities/test/Test_Subprocess.py index b685fbe2fc2..fb2d547d787 100644 --- a/Core/Utilities/test/Test_Subprocess.py +++ b/src/DIRAC/Core/Utilities/test/Test_Subprocess.py @@ -18,6 +18,8 @@ __RCSID__ = "$Id$" +from os.path import dirname, join + # imports import time import pytest @@ -55,7 +57,7 @@ def test_calls(timeout, expected): def test_getChildrenPIDs(): import os os.system("echo $PWD") - mainProcess = Popen(['python', 'Core/Utilities/test/ProcessesCreator.py']) + mainProcess = Popen(['python', join(dirname(__file__), 'ProcessesCreator.py')]) time.sleep(1) res = getChildrenPIDs(mainProcess.pid) assert len(res) == 3 diff --git a/Core/Utilities/test/Test_Time.py b/src/DIRAC/Core/Utilities/test/Test_Time.py similarity index 100% rename from Core/Utilities/test/Test_Time.py rename to src/DIRAC/Core/Utilities/test/Test_Time.py diff --git a/Core/Utilities/test/Test_gCFG.py b/src/DIRAC/Core/Utilities/test/Test_gCFG.py similarity index 100% rename from Core/Utilities/test/Test_gCFG.py rename to src/DIRAC/Core/Utilities/test/Test_gCFG.py diff --git a/Core/Utilities/test/__init__.py b/src/DIRAC/Core/Utilities/test/__init__.py similarity index 100% rename from Core/Utilities/test/__init__.py rename to src/DIRAC/Core/Utilities/test/__init__.py diff --git a/Core/Workflow/Module.py b/src/DIRAC/Core/Workflow/Module.py similarity index 100% rename from Core/Workflow/Module.py rename to src/DIRAC/Core/Workflow/Module.py diff --git a/Core/Workflow/Parameter.py b/src/DIRAC/Core/Workflow/Parameter.py similarity index 100% rename from Core/Workflow/Parameter.py rename to src/DIRAC/Core/Workflow/Parameter.py diff --git a/Core/Workflow/Step.py b/src/DIRAC/Core/Workflow/Step.py similarity index 100% rename from Core/Workflow/Step.py rename to src/DIRAC/Core/Workflow/Step.py diff --git a/Core/Workflow/Utility.py b/src/DIRAC/Core/Workflow/Utility.py similarity index 100% rename from Core/Workflow/Utility.py rename to src/DIRAC/Core/Workflow/Utility.py diff --git a/Core/Workflow/WFEditor/__init__.py b/src/DIRAC/Core/Workflow/WFEditor/__init__.py similarity index 100% rename from Core/Workflow/WFEditor/__init__.py rename to src/DIRAC/Core/Workflow/WFEditor/__init__.py diff --git a/Core/Workflow/Workflow.py b/src/DIRAC/Core/Workflow/Workflow.py similarity index 100% rename from Core/Workflow/Workflow.py rename to src/DIRAC/Core/Workflow/Workflow.py diff --git a/Core/Workflow/WorkflowReader.py b/src/DIRAC/Core/Workflow/WorkflowReader.py similarity index 100% rename from Core/Workflow/WorkflowReader.py rename to src/DIRAC/Core/Workflow/WorkflowReader.py diff --git a/Core/Workflow/__init__.py b/src/DIRAC/Core/Workflow/__init__.py similarity index 100% rename from Core/Workflow/__init__.py rename to src/DIRAC/Core/Workflow/__init__.py diff --git a/Core/Workflow/test/JobSamples.py b/src/DIRAC/Core/Workflow/test/JobSamples.py similarity index 100% rename from Core/Workflow/test/JobSamples.py rename to src/DIRAC/Core/Workflow/test/JobSamples.py diff --git a/Core/Workflow/test/ModulesSamples.py b/src/DIRAC/Core/Workflow/test/ModulesSamples.py similarity index 100% rename from Core/Workflow/test/ModulesSamples.py rename to src/DIRAC/Core/Workflow/test/ModulesSamples.py diff --git a/Core/Workflow/test/WFSamples.py b/src/DIRAC/Core/Workflow/test/WFSamples.py similarity index 100% rename from Core/Workflow/test/WFSamples.py rename to src/DIRAC/Core/Workflow/test/WFSamples.py diff --git a/Core/Workflow/test/__init__.py b/src/DIRAC/Core/Workflow/test/__init__.py similarity index 100% rename from Core/Workflow/test/__init__.py rename to src/DIRAC/Core/Workflow/test/__init__.py diff --git a/Core/Workflow/test/step_g.py b/src/DIRAC/Core/Workflow/test/step_g.py similarity index 100% rename from Core/Workflow/test/step_g.py rename to src/DIRAC/Core/Workflow/test/step_g.py diff --git a/Core/__init__.py b/src/DIRAC/Core/__init__.py similarity index 100% rename from Core/__init__.py rename to src/DIRAC/Core/__init__.py diff --git a/Core/scripts/dirac-agent.py b/src/DIRAC/Core/scripts/dirac-agent.py similarity index 100% rename from Core/scripts/dirac-agent.py rename to src/DIRAC/Core/scripts/dirac-agent.py diff --git a/Core/scripts/dirac-cert-convert.sh b/src/DIRAC/Core/scripts/dirac-cert-convert.sh similarity index 100% rename from Core/scripts/dirac-cert-convert.sh rename to src/DIRAC/Core/scripts/dirac-cert-convert.sh diff --git a/Core/scripts/dirac-configure.py b/src/DIRAC/Core/scripts/dirac-configure.py similarity index 100% rename from Core/scripts/dirac-configure.py rename to src/DIRAC/Core/scripts/dirac-configure.py diff --git a/Core/scripts/dirac-deploy-scripts.py b/src/DIRAC/Core/scripts/dirac-deploy-scripts.py similarity index 100% rename from Core/scripts/dirac-deploy-scripts.py rename to src/DIRAC/Core/scripts/dirac-deploy-scripts.py diff --git a/Core/scripts/dirac-executor.py b/src/DIRAC/Core/scripts/dirac-executor.py similarity index 100% rename from Core/scripts/dirac-executor.py rename to src/DIRAC/Core/scripts/dirac-executor.py diff --git a/Core/scripts/dirac-externals-requirements.py b/src/DIRAC/Core/scripts/dirac-externals-requirements.py similarity index 100% rename from Core/scripts/dirac-externals-requirements.py rename to src/DIRAC/Core/scripts/dirac-externals-requirements.py diff --git a/Core/scripts/dirac-info.py b/src/DIRAC/Core/scripts/dirac-info.py similarity index 100% rename from Core/scripts/dirac-info.py rename to src/DIRAC/Core/scripts/dirac-info.py diff --git a/Core/scripts/dirac-install-db.py b/src/DIRAC/Core/scripts/dirac-install-db.py similarity index 100% rename from Core/scripts/dirac-install-db.py rename to src/DIRAC/Core/scripts/dirac-install-db.py diff --git a/Core/scripts/dirac-install-extension.py b/src/DIRAC/Core/scripts/dirac-install-extension.py similarity index 100% rename from Core/scripts/dirac-install-extension.py rename to src/DIRAC/Core/scripts/dirac-install-extension.py diff --git a/Core/scripts/dirac-install-web-portal.py b/src/DIRAC/Core/scripts/dirac-install-web-portal.py similarity index 100% rename from Core/scripts/dirac-install-web-portal.py rename to src/DIRAC/Core/scripts/dirac-install-web-portal.py diff --git a/src/DIRAC/Core/scripts/dirac-install.py b/src/DIRAC/Core/scripts/dirac-install.py new file mode 100755 index 00000000000..6aa590bcb5a --- /dev/null +++ b/src/DIRAC/Core/scripts/dirac-install.py @@ -0,0 +1,2702 @@ +#!/usr/bin/env python +""" +The main DIRAC installer script. It can be used to install the main DIRAC software, its +modules, web, rest etc. and DIRAC extensions. + +In order to deploy DIRAC you have to provide: globalDefaultsURL, which is by default: +"http://diracproject.web.cern.ch/diracproject/configs/globalDefaults.cfg", but it can be +in the local file system in a separate directory. The content of this file is the following:: + + Installations + { + DIRAC + { + DefaultsLocation = http://diracproject.web.cern.ch/diracproject/dirac.cfg + LocalInstallation + { + PythonVersion = 27 + } + # in case you have a DIRAC extension + LHCb + { + DefaultsLocation = http://lhcb-rpm.web.cern.ch/lhcb-rpm/lhcbdirac/lhcb.cfg + } + } + } + Projects + { + DIRAC + { + DefaultsLocation = http://diracproject.web.cern.ch/diracproject/dirac.cfg + } + # in case you have a DIRAC extension + LHCb + { + DefaultsLocation = http://lhcb-rpm.web.cern.ch/lhcb-rpm/lhcbdirac/lhcb.cfg + } + } + +the DefaultsLocation for example:: + + DefaultsLocation = http://diracproject.web.cern.ch/diracproject/dirac.cfg + +must contain a minimal configuration. The following options must be in this +file:: + + Releases=,UploadCommand=,BaseURL= + +In case you want to overwrite the global configuration file, you have to use --defaultsURL + +After providing the default configuration files, DIRAC or your extension can be installed from: + +1. in a directory you have to be present globalDefaults.cfg, dirac.cfg and all binaries. + For example:: + + zmathe@dzmathe zmathe]$ ls tars/ + dirac.cfg diracos-0.1.md5 diracos-0.1.tar.gz DIRAC-v6r20-pre16.md5 DIRAC-v6r20-pre16.tar.gz + globalDefaults.cfg release-DIRAC-v6r20-pre16.cfg release-DIRAC-v6r20-pre16.md5 + zmathe@dzmathe zmathe]$ + + For example:: + + dirac-install -r v6r20-pre16 --dirac-os --dirac-os-version=0.0.1 -u /home/zmathe/tars + + this command will use /home/zmathe/tars directory for the source code. + It will install DIRAC v6r20-pre16, DIRAC OS 0.1 version + +2. You can use your dedicated web server or the official DIRAC web server + + for example:: + + dirac-install -r v6r20-pre16 --dirac-os --dirac-os-version=0.0.1 + + It will install DIRAC v6r20-pre16 + + You can install an extension of diracos. + + for example:: + + dirac-install -r v9r4-pre2 -l LHCb --dirac-os --dirac-os-version=LHCb:master + +3. You have possibility to install a not-yet-released DIRAC, module or extension using -m or --tag options. + The non release version can be specified. + + for example:: + + dirac-install -l DIRAC -r v6r20-pre16 -g v14r0 -t client -m DIRAC --tag=integration + + It will install DIRAC v6r20-pre16, where the DIRAC package based on integration, other other packages will be + the same what is specified in release.cfg file in v6r20-pre16 tarball. + + dirac-install -l DIRAC -r v6r20-pre16 -g v14r0 -t client -m DIRAC --tag=v6r20-pre22 + + It installs a specific tag + + Note: If the source is not provided, DIRAC repository is used, which is defined in the global + configuration file. + + We can provide the repository url:code repository:::Project:::branch. for example:: + + dirac-install -l DIRAC -r v6r20-pre16 -g v14r0 -t client \\ + -m https://github.com/zmathe/DIRAC.git:::DIRAC:::dev_main_branch, \\ + https://github.com/zmathe/WebAppDIRAC.git:::WebAppDIRAC:::extjs6 -e WebAppDIRAC + + it will install DIRAC based on dev_main_branch and WebAppDIRAC based on extjs6:: + + dirac-install -l DIRAC -r v6r20-pre16 -g v14r0 -t client \\ + -m WebAppDIRAC --tag=integration -e WebAppDIRAC + + it will install DIRAC v6r20-pre16 and WebAppDIRAC integration branch + +You can use install.cfg configuration file:: + + DIRACOS = http://lhcb-rpm.web.cern.ch/lhcb-rpm/dirac/DIRACOS/ + WebAppDIRAC = https://github.com/zmathe/WebAppDIRAC.git + DIRAC=https://github.com/DIRACGrid/DIRAC.git + LocalInstallation + { + # Project = LHCbDIRAC + # The project LHCbDIRAC is not defined in the globalsDefaults.cfg + Project = LHCb + Release = v9r2-pre8 + Extensions = LHCb + ConfigurationServer = dips://lhcb-conf-dirac.cern.ch:9135/Configuration/Server + Setup = LHCb-Production + SkipCAChecks = True + SkipCADownload = True + WebAppDIRAC=extjs6 + DIRAC=rel-v6r20 + } + + dirac-install -l LHCb -r v9r2-pre8 -t server --dirac-os --dirac-os-version=0.0.6 install.cfg + +""" + +from __future__ import unicode_literals, absolute_import, division, print_function + +import sys +import os +import getopt +import imp +import signal +import time +import stat +import shutil +import subprocess +import ssl +import hashlib +import tarfile + +from contextlib import closing +from distutils.version import LooseVersion # pylint: disable=no-name-in-module,import-error + +try: + # For Python 3.0 and later + from urllib.request import urlopen, HTTPError, URLError +except ImportError: + # Fall back to Python 2's urllib2 + from urllib2 import urlopen, HTTPError, URLError +try: + str_type = basestring +except NameError: + str_type = str + +__RCSID__ = "$Id$" + +executablePerms = stat.S_IWUSR | stat.S_IRUSR | stat.S_IXUSR | stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH + + +def S_OK(value=""): + return {'OK': True, 'Value': value} + + +def S_ERROR(msg=""): + return {'OK': False, 'Message': msg} + +############ +# Start of CFG +############ + + +class Params(object): + + def __init__(self): + self.extensions = [] + self.project = 'DIRAC' + self.installation = 'DIRAC' + self.release = "" + self.externalsType = 'client' + self.pythonVersion = '27' + self.platform = "" + self.basePath = os.getcwd() + self.targetPath = os.getcwd() + self.buildExternals = False + self.noAutoBuild = False + self.debug = False + self.externalsOnly = False + self.lcgVer = '' + self.noLcg = False + self.useVersionsDir = False + self.installSource = "" + self.globalDefaults = False + self.timeout = 300 + self.diracOSVersion = '' + self.diracOS = False + self.tag = "" + self.modules = {} + self.externalVersion = "" + self.createLink = False + self.scriptSymlink = False + self.userEnvVariables = {} + + +cliParams = Params() + +### +# Release config manager +### + + +class ReleaseConfig(object): + + class CFG(object): + + def __init__(self, cfgData=""): + """ c'tor + :param self: self reference + :param str cfgData: the content of the configuration file + """ + self.data = {} + self.children = {} + if cfgData: + self.parse(cfgData) + + def parse(self, cfgData): + """ + It parses the configuration file and propagate the data and children + with the content of the cfg file + :param str cfgData: configuration data, which is the content of the configuration file + """ + try: + self.__parse(cfgData) + except BaseException: + import traceback + traceback.print_exc() + raise + return self + + def getChild(self, path): + """ + It return the child of a given section + :param str, list, tuple path: for example: Installations/DIRAC, Projects/DIRAC + :return object It returns a CFG instance + """ + + child = self + if isinstance(path, (list, tuple)): + pathList = path + else: + pathList = [sec.strip() for sec in path.split("/") if sec.strip()] + for childName in pathList: + if childName not in child.children: + return False + child = child.children[childName] + return child + + def __parse(self, cfgData, cIndex=0): + """ + It parse a given DIRAC cfg file and store the result in self.data variable. + + :param str cfgData: the content of the configuration file + :param int cIndex: it is the new line counter + """ + + childName = "" + numLine = 0 + while cIndex < len(cfgData): + eol = cfgData.find("\n", cIndex) + if eol < cIndex: + # End? + return cIndex + numLine += 1 + if eol == cIndex: + cIndex += 1 + continue + line = cfgData[cIndex: eol].strip() + # Jump EOL + cIndex = eol + 1 + if not line or line[0] == "#": + continue + if line.find("+=") > -1: + fields = line.split("+=") + opName = fields[0].strip() + if opName in self.data: + self.data[opName] += ', %s' % '+='.join(fields[1:]).strip() + else: + self.data[opName] = '+='.join(fields[1:]).strip() + continue + + if line.find("=") > -1: + fields = line.split("=") + self.data[fields[0].strip()] = "=".join(fields[1:]).strip() + continue + + opFound = line.find("{") + if opFound > -1: + childName += line[:opFound].strip() + if not childName: + raise Exception("No section name defined for opening in line %s" % numLine) + childName = childName.strip() + self.children[childName] = ReleaseConfig.CFG() + eoc = self.children[childName].__parse(cfgData, cIndex) + cIndex = eoc + childName = "" + continue + + if line == "}": + return cIndex + # Must be name for section + childName += line.strip() + return cIndex + + def createSection(self, name, cfg=None): + """ + It creates a subsection for an existing CS section. + :param str name: the name of the section + :param object cfg: the ReleaseConfig.CFG object loaded into memory + """ + + if isinstance(name, (list, tuple)): + pathList = name + else: + pathList = [sec.strip() for sec in name.split("/") if sec.strip()] + parent = self + for lev in pathList[:-1]: + if lev not in parent.children: + parent.children[lev] = ReleaseConfig.CFG() + parent = parent.children[lev] + secName = pathList[-1] + if secName not in parent.children: + if not cfg: + cfg = ReleaseConfig.CFG() + parent.children[secName] = cfg + return parent.children[secName] + + def isSection(self, obList): + """ + Checks if a given path is a section + :param str objList: is a path: for example: Releases/v6r20-pre16 + """ + return self.__exists([ob.strip() for ob in obList.split("/") if ob.strip()]) == 2 + + def sections(self): + """ + Returns all sections + """ + return [k for k in self.children] + + def isOption(self, obList): + return self.__exists([ob.strip() for ob in obList.split("/") if ob.strip()]) == 1 + + def options(self): + """ + Returns the options + """ + return [k for k in self.data] + + def __exists(self, obList): + """ + Check the existence of a certain element + + :param list obList: the list of cfg element names. + for example: [Releases,v6r20-pre16] + """ + if len(obList) == 1: + if obList[0] in self.children: + return 2 + elif obList[0] in self.data: + return 1 + else: + return 0 + if obList[0] in self.children: + return self.children[obList[0]].__exists(obList[1:]) + return 0 + + def get(self, opName, defaultValue=None): + """ + It return the value of a certain option + + :param str opName: the name of the option + :param str defaultValue: the default value of a given option + """ + try: + value = self.__get([op.strip() for op in opName.split("/") if op.strip()]) + except KeyError: + if defaultValue is not None: + return defaultValue + raise + if defaultValue is None: + return value + defType = type(defaultValue) + if isinstance(defType, bool): + return value.lower() in ("1", "true", "yes") + try: + return defType(value) + except ValueError: + return defaultValue + + def __get(self, obList): + """ + It return a given section + + :param list obList: the list of cfg element names. + """ + if len(obList) == 1: + if obList[0] in self.data: + return self.data[obList[0]] + raise KeyError("Missing option %s" % obList[0]) + if obList[0] in self.children: + return self.children[obList[0]].__get(obList[1:]) + raise KeyError("Missing section %s" % obList[0]) + + def toString(self, tabs=0): + """ + It return the configuration file as a string + :param int tabs: the number of tabs used to format the CS string + """ + + lines = ["%s%s = %s" % (" " * tabs, opName, self.data[opName]) for opName in self.data] + for secName in self.children: + lines.append("%s%s" % (" " * tabs, secName)) + lines.append("%s{" % (" " * tabs)) + lines.append(self.children[secName].toString(tabs + 1)) + lines.append("%s}" % (" " * tabs)) + return "\n".join(lines) + + def getOptions(self, path=""): + """ + Rturns the options for a given path + + :param str path: the path to the CS element + """ + parentPath = [sec.strip() for sec in path.split("/") if sec.strip()][:-1] + if parentPath: + parent = self.getChild(parentPath) + else: + parent = self + if not parent: + return [] + return tuple(parent.data) + + def delPath(self, path): + """ + It deletes a given CS element + + :param str path: the path to the CS element + """ + path = [sec.strip() for sec in path.split("/") if sec.strip()] + if not path: + return + keyName = path[-1] + parentPath = path[:-1] + if parentPath: + parent = self.getChild(parentPath) + else: + parent = self + if parent: + parent.data.pop(keyName) + + def update(self, path, cfg): + """ + Used to update the CS + + :param str path: path to the CS element + :param object cfg: the CS object + """ + parent = self.getChild(path) + if not parent: + self.createSection(path, cfg) + return + parent.__apply(cfg) + + def __apply(self, cfg): + """ + It adds a certain cfg subsection to a given section + + :param object cfg: the CS object + """ + for k in cfg.sections(): + if k in self.children: + self.children[k].__apply(cfg.getChild(k)) + else: + self.children[k] = cfg.getChild(k) + for k in cfg.options(): + self.data[k] = cfg.get(k) +############################################################################ +# END OF CFG CLASS +############################################################################ + + def __init__(self, instName='DIRAC', projectName='DIRAC', globalDefaultsURL=None): + """ c'tor + :param str instName: the name of the installation + :param str projectName: the name of the project + :param str globalDefaultsURL: the default url + """ + if globalDefaultsURL: + self.globalDefaultsURL = globalDefaultsURL + else: + self.globalDefaultsURL = "http://diracproject.web.cern.ch/diracproject/configs/globalDefaults.cfg" + self.globalDefaults = ReleaseConfig.CFG() + self.loadedCfgs = [] + self.prjDepends = {} + self.diracBaseModules = {} + self.prjRelCFG = {} + self.projectsLoadedBy = {} + self.cfgCache = {} + + self.debugCB = False + self.instName = instName + self.projectName = projectName + + def setDebugCB(self, debFunc): + """ + It is used by the dirac-distribution. It sets the debug function + """ + self.debugCB = debFunc + + def __dbgMsg(self, msg): + """ + :param str msg: the debug message + """ + if self.debugCB: + self.debugCB(msg) + + def __loadCFGFromURL(self, urlcfg, checkHash=False): + """ + It is used to load the configuration file + + :param str urlcfg: the location of the source repository and + where the default configuration file is exists. + :param bool checkHash: check if the file is corrupted. + """ + # This can be a local file + if os.path.exists(urlcfg): + with open(urlcfg, 'r') as relFile: + cfgData = relFile.read() + else: + if urlcfg in self.cfgCache: + return S_OK(self.cfgCache[urlcfg]) + try: + cfgData = urlretrieveTimeout(urlcfg, timeout=cliParams.timeout) + if not cfgData: + return S_ERROR("Could not get data from %s" % urlcfg) + except BaseException: + return S_ERROR("Could not open %s" % urlcfg) + try: + # cfgData = cfgFile.read() + cfg = ReleaseConfig.CFG(cfgData) + except Exception as excp: + return S_ERROR("Could not parse %s: %s" % (urlcfg, excp)) + # cfgFile.close() + if not checkHash: + self.cfgCache[urlcfg] = cfg + return S_OK(cfg) + try: + md5path = urlcfg[:-4] + ".md5" + if os.path.exists(md5path): + md5File = open(md5path, 'r') + md5Data = md5File.read() + md5File.close() + else: + md5Data = urlretrieveTimeout(md5path, timeout=60) + md5Hex = md5Data.strip() + # md5File.close() + if md5Hex != hashlib.md5(cfgData.encode('utf-8')).hexdigest(): + return S_ERROR("Hash check failed on %s" % urlcfg) + except Exception as excp: + return S_ERROR("Hash check failed on %s: %s" % (urlcfg, excp)) + self.cfgCache[urlcfg] = cfg + return S_OK(cfg) + + def loadInstallationDefaults(self): + """ + Load the default configurations + """ + result = self.__loadGlobalDefaults() + if not result['OK']: + return result + return self.__loadObjectDefaults("Installations", self.instName) + + def loadProjectDefaults(self): + """ + Load default configurations + """ + result = self.__loadGlobalDefaults() + if not result['OK']: + return result + return self.__loadObjectDefaults("Projects", self.projectName) + + def __loadGlobalDefaults(self): + """ + It loads the default configuration files + """ + + globalDefaultsCVMFSPath = "/cvmfs/dirac.egi.eu/admin/globalDefaults.cfg" + self.__dbgMsg("Loading global defaults from: %s" % globalDefaultsCVMFSPath) + result = self.__loadCFGFromURL(globalDefaultsCVMFSPath) + if not result['OK']: + self.__dbgMsg("Loading global defaults from: %s" % self.globalDefaultsURL) + result = self.__loadCFGFromURL(self.globalDefaultsURL) + if not result['OK']: + return result + self.globalDefaults = result['Value'] + for k in ("Installations", "Projects"): + if not self.globalDefaults.isSection(k): + self.globalDefaults.createSection(k) + self.__dbgMsg("Loaded global defaults") + return S_OK() + + def __loadObjectDefaults(self, rootPath, objectName): + """ + It loads the CFG, if it is not loaded. + :param str rootPath: the main section. for example: Installations + :param str objectName: The name of the section. for example: DIRAC + """ + + basePath = "%s/%s" % (rootPath, objectName) + if basePath in self.loadedCfgs: + return S_OK() + + # Check if it's a direct alias + try: + aliasTo = self.globalDefaults.get(basePath) + except KeyError: + aliasTo = False + + if aliasTo: + self.__dbgMsg("%s is an alias to %s" % (objectName, aliasTo)) + result = self.__loadObjectDefaults(rootPath, aliasTo) + if not result['OK']: + return result + cfg = result['Value'] + self.globalDefaults.update(basePath, cfg) + return S_OK() + + # Load the defaults + if self.globalDefaults.get("%s/SkipDefaults" % basePath, False): + defaultsLocation = "" + else: + defaultsLocation = self.globalDefaults.get("%s/DefaultsLocation" % basePath, "") + + if not defaultsLocation: + self.__dbgMsg("No defaults file defined for %s %s" % (rootPath.lower()[:-1], objectName)) + else: + self.__dbgMsg("Defaults for %s are in %s" % (basePath, defaultsLocation)) + result = self.__loadCFGFromURL(defaultsLocation) + if not result['OK']: + return result + cfg = result['Value'] + self.globalDefaults.update(basePath, cfg) + + # Check if the defaults have a sub alias + try: + aliasTo = self.globalDefaults.get("%s/Alias" % basePath) + except KeyError: + aliasTo = False + + if aliasTo: + self.__dbgMsg("%s is an alias to %s" % (objectName, aliasTo)) + result = self.__loadObjectDefaults(rootPath, aliasTo) + if not result['OK']: + return result + cfg = result['Value'] + self.globalDefaults.update(basePath, cfg) + + self.loadedCfgs.append(basePath) + return S_OK(self.globalDefaults.getChild(basePath)) + + def loadInstallationLocalDefaults(self, args): + """ + Load the configuration file from a file + + :param str args: the arguments in which to look for configuration file names + """ + + # at the end we load the local configuration and merge it with the global cfg + argList = list(args) + if os.path.exists('etc/dirac.cfg') and 'etc/dirac.cfg' not in args: + argList = ['etc/dirac.cfg'] + argList + + for arg in argList: + if arg.endswith(".cfg") and ':::' not in arg: + fileName = arg + else: + continue + + logNOTICE("Defaults for LocalInstallation are in %s" % fileName) + try: + fd = open(fileName, "r") + cfg = ReleaseConfig.CFG().parse(fd.read()) + fd.close() + except Exception as excp: + logERROR("Could not load %s: %s" % (fileName, excp)) + continue + + self.globalDefaults.update("Installations/%s" % self.instName, cfg) + self.globalDefaults.update("Projects/%s" % self.instName, cfg) + if self.projectName: + # we have an extension and have a local cfg file + self.globalDefaults.update("Projects/%s" % self.projectName, cfg) + + logNOTICE("Loaded %s" % arg) + + def getModuleVersionFromLocalCfg(self, moduleName): + """ + It returns the version of a certain module defined in the LocalInstallation section + :param str moduleName: + :return str: the version of a certain module + """ + return self.globalDefaults.get("Installations/%s/LocalInstallation/%s" % (self.instName, moduleName), "") + + def getInstallationCFG(self, instName=None): + """ + Returns the installation name + + :param str instName: the installation name + """ + if not instName: + instName = self.instName + return self.globalDefaults.getChild("Installations/%s" % instName) + + def getInstallationConfig(self, opName, instName=None): + """ + It returns the configurations from the Installations section. + This is usually provided in the local configuration file + + :param str opName: the option name for example: LocalInstallation/Release + :param str instName: + """ + if not instName: + instName = self.instName + return self.globalDefaults.get("Installations/%s/%s" % (instName, opName)) + + def isProjectLoaded(self, project): + """ + Checks if the project is loaded. + + :param str project: the name of the project + """ + return project in self.prjRelCFG + + def getTarsLocation(self, project, module=None): + """ + Returns the location of the binaries for a given project for example: LHCb or DIRAC, etc... + + :param str project: the name of the project + """ + sourceUrl = self.globalDefaults.get("Projects/%s/BaseURL" % project, "") + if module: + # in case we define a different URL in the CS + differntSourceUrl = self.globalDefaults.get("Projects/%s/%s" % (project, module), "") + if differntSourceUrl: + sourceUrl = differntSourceUrl + if sourceUrl: + return S_OK(sourceUrl) + return S_ERROR("Don't know how to find the installation tarballs for project %s" % project) + + def getDiracOsLocation(self, useVanillaDiracOS=False): + """ + Returns the location of the DIRAC os binary for a given project for example: LHCb or DIRAC, etc... + :param bool useVanillaDiracOS: flag to take diracos distribution from the default location + :return: the location of the tar balls + """ + keysToConsider = [] + if not useVanillaDiracOS: + keysToConsider += [ + "Installations/%s/DIRACOS" % self.projectName, + "Projects/%s/DIRACOS" % self.projectName, + ] + keysToConsider += [ + "Installations/DIRAC/DIRACOS", + "Projects/DIRAC/DIRACOS", + ] + + for key in keysToConsider: + location = self.globalDefaults.get(key, "") + if location: + logDEBUG("Using DIRACOS tarball URL from configuration key %s" % key) + return location + + def getUploadCommand(self, project=None): + """ + It returns the command used to upload the binary + + :param str project: the name of the project + """ + if not project: + project = self.projectName + defLoc = self.globalDefaults.get("Projects/%s/UploadCommand" % project, "") + if defLoc: + return S_OK(defLoc) + return S_ERROR("No UploadCommand for %s" % project) + + def __loadReleaseConfig(self, project, release, releaseMode, sourceURL=None, relLocation=None): + """ + It loads the release configuration file + + :param str project: the name of the project + :param str release: the release version + :param str releaseMode: the type of the release server/client + :param str sourceURL: the source of the binary + :param str relLocation: the release configuration file + """ + if project not in self.prjRelCFG: + self.prjRelCFG[project] = {} + if release in self.prjRelCFG[project]: + self.__dbgMsg("Release config for %s:%s has already been loaded" % (project, release)) + return S_OK() + + if relLocation: + relcfgLoc = relLocation + else: + if releaseMode: + try: + relcfgLoc = self.globalDefaults.get("Projects/%s/Releases" % project) + except KeyError: + return S_ERROR("Missing Releases file for project %s" % project) + else: + if not sourceURL: + result = self.getTarsLocation(project) + if not result['OK']: + return result + siu = result['Value'] + else: + siu = sourceURL + relcfgLoc = "%s/release-%s-%s.cfg" % (siu, project, release) + self.__dbgMsg("Releases file is %s" % relcfgLoc) + result = self.__loadCFGFromURL(relcfgLoc, checkHash=not releaseMode) + if not result['OK']: + return result + self.prjRelCFG[project][release] = result['Value'] + self.__dbgMsg("Loaded releases file %s" % relcfgLoc) + + return S_OK(self.prjRelCFG[project][release]) + + def getReleaseCFG(self, project, release): + """ + Returns the release configuration object + + :param str project: the name of the project + :param str release: the release version + """ + return self.prjRelCFG[project][release] + + def dumpReleasesToPath(self): + """ + It dumps the content of the loaded configuration (memory content) to + a given file + """ + for project in self.prjRelCFG: + prjRels = self.prjRelCFG[project] + for release in prjRels: + self.__dbgMsg("Dumping releases file for %s:%s" % (project, release)) + fd = open( + os.path.join( + cliParams.targetPath, "releases-%s-%s.cfg" % + (project, release)), "w") + fd.write(prjRels[release].toString()) + fd.close() + + def __checkCircularDependencies(self, key, routePath=None): + """ + Check the dependencies + + :param str key: the name of the project and the release version + :param list routePath: it stores the software packages, used to check the + dependency + """ + + if not routePath: + routePath = [] + if key not in self.projectsLoadedBy: + return S_OK() + routePath.insert(0, key) + for lKey in self.projectsLoadedBy[key]: + if lKey in routePath: + routePath.insert(0, lKey) + route = "->".join(["%s:%s" % sKey for sKey in routePath]) + return S_ERROR("Circular dependency found for %s: %s" % ("%s:%s" % lKey, route)) + result = self.__checkCircularDependencies(lKey, routePath) + if not result['OK']: + return result + routePath.pop(0) + return S_OK() + + def loadProjectRelease(self, releases, + project=None, + sourceURL=None, + releaseMode=None, + relLocation=None): + """ + This method loads all project configurations (*.cfg). If a project is an extension of DIRAC, + it will load the extension and after will load the base DIRAC module. + + :param list releases: list of releases, which will be loaded: for example: v6r19 + :param str project: the name of the project, if it is given. For example: DIRAC + :param str sourceURL: the code repository + :param str releaseMode: + :param str relLocation: local configuration file, + which contains the releases. for example: file:///`pwd`/releases.cfg + """ + + if not project: + project = self.projectName + + if not isinstance(releases, (list, tuple)): + releases = [releases] + + # Load defaults + result = self.__loadObjectDefaults("Projects", project) + if not result['OK']: + self.__dbgMsg("Could not load defaults for project %s" % project) + return result + + if project not in self.prjDepends: + self.prjDepends[project] = {} + + for release in releases: + self.__dbgMsg("Processing dependencies for %s:%s" % (project, release)) + result = self.__loadReleaseConfig(project, release, releaseMode, sourceURL, relLocation) + if not result['OK']: + return result + relCFG = result['Value'] + # Calculate dependencies and avoid circular deps + self.prjDepends[project][release] = [(project, release)] + relDeps = self.prjDepends[project][release] + + if not relCFG.getChild("Releases/%s" % (release)): # pylint: disable=no-member + return S_ERROR( + "Release %s is not defined for project %s in the release file" % + (release, project)) + + initialDeps = self.getReleaseDependencies(project, release) + if initialDeps: + self.__dbgMsg("%s %s depends on %s" % + (project, release, ", ".join(["%s:%s" % + (k, initialDeps[k]) for k in initialDeps]))) + relDeps.extend([(p, initialDeps[p]) for p in initialDeps]) + for depProject in initialDeps: + depVersion = initialDeps[depProject] + # Check if already processed + dKey = (depProject, depVersion) + if dKey not in self.projectsLoadedBy: + self.projectsLoadedBy[dKey] = [] + self.projectsLoadedBy[dKey].append((project, release)) + result = self.__checkCircularDependencies(dKey) + if not result['OK']: + return result + # if it has already been processed just return OK + if len(self.projectsLoadedBy[dKey]) > 1: + return S_OK() + + # Load dependencies and calculate incompatibilities + result = self.loadProjectRelease(depVersion, project=depProject) + if not result['OK']: + return result + subDep = self.prjDepends[depProject][depVersion] + # Merge dependencies + for sKey in subDep: + if sKey not in relDeps: + relDeps.append(sKey) + continue + prj, vrs = sKey + for pKey in relDeps: + if pKey[0] == prj and pKey[1] != vrs: + errMsg = "%s is required with two different versions ( %s and %s ) \ + starting with %s:%s" % (prj, + pKey[1], vrs, + project, release) + return S_ERROR(errMsg) + + # Same version already required + if project in relDeps and relDeps[project] != release: + errMsg = "%s:%s requires itself with a different version through dependencies ( %s )" % ( + project, release, relDeps[project]) + return S_ERROR(errMsg) + + # we have now all dependencies, let's retrieve the resources (code repository) + for project, version in relDeps: + if project in self.diracBaseModules: + continue + modules = self.getModulesForRelease(version, project) + if modules['OK']: + for dependency in modules['Value']: + self.diracBaseModules.setdefault(dependency, {}) + self.diracBaseModules[dependency]['Version'] = modules['Value'][dependency] + res = self.getModSource(version, dependency, project) + if not res['OK']: + self.__dbgMsg( + "Unable to found the source URL for %s : %s" % + (dependency, res['Message'])) + else: + self.diracBaseModules[dependency]['sourceUrl'] = res['Value'][1] + + return S_OK() + + def getReleaseOption(self, project, release, option): + """ + Returns a given option + + :param str project: the name of the project + :param str release: the release version + :param str option: the option name + """ + try: + return self.prjRelCFG[project][release].get(option) + except KeyError: + self.__dbgMsg("Missing option %s for %s:%s" % (option, project, release)) + # try to found the option in a different release + for project in self.prjRelCFG: + for release in self.prjRelCFG[project]: + if self.prjRelCFG[project][release].isOption(option): + return self.prjRelCFG[project][release].get(option) + return False + + def getReleaseDependencies(self, project, release): + """ + It return the dependencies for a certain project + + :param str project: the name of the project + :param str release: the release version + """ + try: + data = self.prjRelCFG[project][release].get("Releases/%s/Depends" % release) + except KeyError: + return {} + data = [field for field in data.split(",") if field.strip()] + deps = {} + for field in data: + field = field.strip() + if not field: + continue + pv = field.split(":") + if len(pv) == 1: + deps[pv[0].strip()] = release + else: + deps[pv[0].strip()] = ":".join(pv[1:]).strip() + return deps + + def getModulesForRelease(self, release, project=None): + """ + Returns the modules for a given release for example: WebAppDIRAC, + RESTDIRAC, LHCbWebAppDIRAC, etc + + :param str release: the release version + :param str project: the project name + """ + if not project: + project = self.projectName + if project not in self.prjRelCFG: + return S_ERROR("Project %s has not been loaded. I'm a MEGA BUG! Please report me!" % project) + if release not in self.prjRelCFG[project]: + return S_ERROR("Version %s has not been loaded for project %s" % (release, project)) + config = self.prjRelCFG[project][release] + if not config.isSection("Releases/%s" % release): + return S_ERROR("Release %s is not defined for project %s" % (release, project)) + # Defined Modules explicitly in the release + modules = self.getReleaseOption(project, release, "Releases/%s/Modules" % release) + if modules: + dMods = {} + for entry in [entry.split(":") for entry in modules.split( + ",") if entry.strip()]: # pylint: disable=no-member + if len(entry) == 1: + dMods[entry[0].strip()] = release + else: + dMods[entry[0].strip()] = entry[1].strip() + modules = dMods + else: + # Default modules with the same version as the release version + modules = self.getReleaseOption(project, release, "DefaultModules") + if modules: + modules = dict((modName.strip(), release) for modName in modules.split(",") + if modName.strip()) # pylint: disable=no-member + else: + # Mod = project and same version + modules = {project: release} + # Check project is in the modNames if not DIRAC + if project != "DIRAC": + for modName in modules: + if modName.find(project) != 0: + return S_ERROR("Module %s does not start with the name %s" % (modName, project)) + return S_OK(modules) + + def getModSource(self, release, modName, project=None): + """ + It reads the Sources section from the .cfg file for example: + Sources + { + Web = git://github.com/DIRACGrid/DIRACWeb.git + VMDIRAC = git://github.com/DIRACGrid/VMDIRAC.git + DIRAC = git://github.com/DIRACGrid/DIRAC.git + BoincDIRAC = git://github.com/DIRACGrid/BoincDIRAC.git + RESTDIRAC = git://github.com/DIRACGrid/RESTDIRAC.git + COMDIRAC = git://github.com/DIRACGrid/COMDIRAC.git + WebAppDIRAC = git://github.com/DIRACGrid/WebAppDIRAC.git + } + + :param str release: the release which is already loaded for example: v6r19 + :param str modName: the name of the DIRAC module for example: WebAppDIRAC + :param str project: the name of the project for example: DIRAC + """ + + if self.projectName not in self.prjRelCFG: + return S_ERROR( + "Project %s has not been loaded. I'm a MEGA BUG! Please report me!" % + self.projectName) + + if not project: + project = self.projectName + modLocation = self.getReleaseOption(project, release, "Sources/%s" % modName) + if not modLocation: + return S_ERROR("Source origin for module %s is not defined" % modName) + modTpl = [field.strip() for field in modLocation.split( + "|") if field.strip()] # pylint: disable=no-member + if len(modTpl) == 1: + return S_OK((False, modTpl[0])) + return S_OK((modTpl[0], modTpl[1])) + + def getExternalsVersion(self, release=None): + """ + It returns the version of DIRAC Externals. If it is not provided, + uses the default cfg + + :param str release: the release version + """ + + if 'DIRAC' not in self.prjRelCFG: + return False + if not release: + release = list(self.prjRelCFG['DIRAC']) + release = sorted(release, key=LooseVersion)[-1] + try: + return self.prjRelCFG['DIRAC'][release].get('Releases/%s/Externals' % release) + except KeyError: + return False + + def getDiracOSExtensionAndVersion(self, diracOSVersion): + """ + This method return the diracos and version taking into + account the extension. The file format will be .tar.gz + + :param str diracOSVersion: column separated string for example: LHCb:v1 + :return: if the extension is not provided, it will return DIRACOS defined in DIRAC otherwise + the DIRACOS specified in the extension + """ + if ":" in diracOSVersion: + package, packageVersion = [i.strip() for i in diracOSVersion.split(':')] + return [package + 'diracos', packageVersion] + else: + return ['diracos', diracOSVersion] + + def getDiracOSVersion(self, diracOSVersion=None): + """ + It returns the DIRACOS version + :param str diracOSVersion: the OS version + """ + + if diracOSVersion: + return self.getDiracOSExtensionAndVersion(diracOSVersion) + try: + diracOSVersion = self.prjRelCFG[self.projectName][cliParams.release].get( + "Releases/%s/DIRACOS" % cliParams.release, diracOSVersion) + if not diracOSVersion: + # the DIRAC extension does not specify DIRACOS version + for release in self.prjRelCFG['DIRAC']: + logWARN("Getting DIRACOS version from DIRAC %s!" % release) + diracOSVersion = self.prjRelCFG['DIRAC'][release].get( + "Releases/%s/DIRACOS" % release, diracOSVersion) + except KeyError: + pass + return self.getDiracOSExtensionAndVersion(diracOSVersion) + + def getLCGVersion(self, lcgVersion=None): + """ + It returns the LCG version + :param str lcgVersion: LCG version + """ + if lcgVersion: + return lcgVersion + try: + return self.prjRelCFG[self.projectName][cliParams.release].get( + "Releases/%s/LcgVer" % cliParams.release, lcgVersion) + except KeyError: + pass + return lcgVersion + + def getModulesToInstall(self, release, extensions=None): + """ + It returns the modules to be installed. + :param str release: the release version to be deployed + :param str extensions: DIRAC extension + :return: the order of the nodules and modules to be installed. + """ + if not extensions: + extensions = [] + extraFound = [] + modsToInstall = {} + modsOrder = [] + if self.projectName not in self.prjDepends: + return S_ERROR("Project %s has not been loaded" % self.projectName) + if release not in self.prjDepends[self.projectName]: + return S_ERROR( + "Version %s has not been loaded for project %s" % + (release, self.projectName)) + # Get a list of projects with their releases + projects = list(self.prjDepends[self.projectName][release]) + for project, relVersion in projects: + try: + requiredModules = self.prjRelCFG[project][relVersion].get("RequiredExtraModules") + requiredModules = [modName.strip() + for modName in requiredModules.split("/") if modName.strip()] + except KeyError: + requiredModules = [] + for modName in requiredModules: + if modName not in extensions: + extensions.append(modName) + self.__dbgMsg("Discovering modules to install for %s (%s)" % (project, relVersion)) + result = self.getModulesForRelease(relVersion, project) + if not result['OK']: + return result + modVersions = result['Value'] + try: + defaultMods = self.prjRelCFG[project][relVersion].get("DefaultModules") + modNames = [mod.strip() for mod in defaultMods.split(",") if mod.strip()] + except KeyError: + modNames = [] + for extension in extensions: + # Check if the version of the extension module is specified in the command line + extraVersion = None + if ":" in extension: + extension, extraVersion = extension.split(":") + modVersions[extension] = extraVersion + if extension in modVersions: + modNames.append(extension) + extraFound.append(extension) + if 'DIRAC' not in extension: + dextension = "%sDIRAC" % extension + if dextension in modVersions: + modNames.append(dextension) + extraFound.append(extension) + modNameVer = ["%s:%s" % (modName, modVersions[modName]) for modName in modNames] + self.__dbgMsg("Modules to be installed for %s are: %s" % (project, ", ".join(modNameVer))) + for modName in modNames: + result = self.getTarsLocation(project, modName) + if not result['OK']: + return result + tarsURL = result['Value'] + modVersion = modVersions[modName] + defLoc = self.getModuleVersionFromLocalCfg(modName) + if defLoc: + modVersion = defLoc # this overwrite the version which are defined in the release.cfg + modsToInstall[modName] = (tarsURL, modVersion) + modsOrder.insert(0, modName) + + for modName in extensions: + if modName.split(":")[0] not in extraFound: + return S_ERROR("No module %s defined. You sure it's defined for this release?" % modName) + + return S_OK((modsOrder, modsToInstall)) + + +################################################################################# +# End of ReleaseConfig +################################################################################# + + +# platformAlias = { 'Darwin_i386_10.6' : 'Darwin_i386_10.5' } +platformAlias = {} + +#### +# Start of helper functions +#### + + +def logDEBUG(msg): + """ + :param str msg: debug message + """ + if cliParams.debug: + for line in msg.split("\n"): + print("%s UTC dirac-install [DEBUG] %s" % (time.strftime('%Y-%m-%d %H:%M:%S', + time.gmtime()), + line)) + sys.stdout.flush() + + +def logERROR(msg): + """ + :param str msg: error message + """ + for line in msg.split("\n"): + print("%s UTC dirac-install [ERROR] %s" % (time.strftime('%Y-%m-%d %H:%M:%S', + time.gmtime()), + line)) + sys.stdout.flush() + + +def logWARN(msg): + """ + :param str msg: warning message + """ + for line in msg.split("\n"): + print("%s UTC dirac-install [WARN] %s" % (time.strftime('%Y-%m-%d %H:%M:%S', + time.gmtime()), + line)) + sys.stdout.flush() + + +def logNOTICE(msg): + """ + :param str msg: notice message + """ + for line in msg.split("\n"): + print("%s UTC dirac-install [NOTICE] %s" % (time.strftime('%Y-%m-%d %H:%M:%S', + time.gmtime()), + line)) + sys.stdout.flush() + + +def alarmTimeoutHandler(*args): + """ + When a connection time out then raise and exception + """ + raise Exception('Timeout') + + +def urlretrieveTimeout(url, fileName='', timeout=0, retries=3): + """ + Retrieve remote url to local file, with timeout wrapper + + :param str fileName: file name + :param int timeout: time out in second used for downloading the files. + """ + if fileName: + # This can be a local file + if os.path.exists(url): # we do not download from web, use locally + logDEBUG('Local file used: "%s"' % url) + shutil.copy(url, fileName) + return True + localFD = open(fileName, "wb") + + # NOTE: Not thread-safe, since all threads will catch same alarm. + # This is OK for dirac-install, since there are no threads. + logDEBUG('Retrieving remote file "%s"' % url) + + urlData = '' + if timeout: + signal.signal(signal.SIGALRM, alarmTimeoutHandler) + # set timeout alarm + signal.alarm(timeout + 5) + try: + # if "http_proxy" in os.environ and os.environ['http_proxy']: + # proxyIP = os.environ['http_proxy'] + # proxy = urllib2.ProxyHandler( {'http': proxyIP} ) + # opener = urllib2.build_opener( proxy ) + # #opener = urllib2.build_opener() + # urllib2.install_opener( opener ) + + # Try to use insecure context explicitly, needed for python >= 2.7.9 + try: + context = ssl._create_unverified_context() + remoteFD = urlopen(url, context=context) # pylint: disable=unexpected-keyword-arg + # the keyword 'context' is present from 2.7.9+ + except AttributeError: + remoteFD = urlopen(url) + + expectedBytes = 0 + # Sometimes repositories do not return Content-Length parameter + try: + expectedBytes = int(remoteFD.info()['Content-Length']) + except Exception: + logWARN('Content-Length parameter not returned, skipping expectedBytes check') + + receivedBytes = 0 + data = remoteFD.read(16384) + count = 1 + progressBar = False + while data: + receivedBytes += len(data) + if fileName: + localFD.write(data) + else: + urlData += data.decode('utf8', 'ignore') + data = remoteFD.read(16384) + if count % 20 == 0 and sys.stdout.isatty(): + print(u'\033[1D' + ".", end=" ") + sys.stdout.flush() + progressBar = True + count += 1 + if progressBar and sys.stdout.isatty(): + # return cursor to the beginning of the line + print('\033[1K', end=" ") + print('\033[1A') + if fileName: + localFD.close() + remoteFD.close() + if receivedBytes != expectedBytes and expectedBytes > 0: + logERROR("File should be %s bytes but received %s" % (expectedBytes, receivedBytes)) + return False + except HTTPError as x: + if x.code == 404: + logERROR("%s does not exist" % url) + if timeout: + signal.alarm(0) + return False + else: + logWARN('Status code accessing URL %s was %s' % (url, x.getcode())) + if retries: + logWARN('Will retry after 30 seconds, %s retries remaining' % retries) + time.sleep(30) + return urlretrieveTimeout(url, fileName=fileName, timeout=timeout, retries=retries - 1) + else: + logERROR("No retries remaining for %s" % url) + sys.exit(1) + except URLError: + logERROR('Timeout after %s seconds on transfer request for "%s"' % (str(timeout), url)) + except Exception as x: + if x == 'Timeout': + logERROR('Timeout after %s seconds on transfer request for "%s"' % (str(timeout), url)) + if timeout: + signal.alarm(0) + raise x + if timeout: + signal.alarm(0) + + if fileName: + return True + else: + return urlData + + +def downloadAndExtractTarball(tarsURL, pkgName, pkgVer, checkHash=True, cache=False): + """ + It downloads and extracts a given tarball from a given destination: file system, + web server or code repository. + + :param str tarsURL: the location of the source repository + :param str pkgName: the name of the package to be installed + :param str pkgVer: the version of the package + :param bool checkHash: check the sanity of the file + :param bool cache: use local cache for the tarballs + + """ + tarName = "%s-%s.tar.gz" % (pkgName, pkgVer) + tarPath = os.path.join(cliParams.targetPath, tarName) + tarFileURL = "%s/%s" % (tarsURL, tarName) + tarFileCVMFS = "/cvmfs/dirac.egi.eu/installSource/%s" % tarName + cacheDir = os.path.join(cliParams.basePath, ".installCache") + tarCachePath = os.path.join(cacheDir, tarName) + isSource = False + if cache and os.path.isfile(tarCachePath): + logNOTICE("Using cached copy of %s" % tarName) + shutil.copy(tarCachePath, tarPath) + elif os.path.exists(tarFileCVMFS): + logNOTICE("Using CVMFS copy of %s" % tarName) + tarPath = tarFileCVMFS + checkHash = False + cache = False + else: + logNOTICE("Retrieving %s" % tarFileURL) + try: + if not urlretrieveTimeout(tarFileURL, tarPath, cliParams.timeout): + if os.path.exists(tarPath): + os.unlink(tarPath) + retVal = checkoutFromGit(pkgName, tarsURL, pkgVer) + if not retVal['OK']: + logERROR("Cannot download %s" % tarName) + logERROR("Cannot download %s" % retVal['Message']) + return False + else: + isSource = True + except Exception as e: + logERROR("Cannot download %s: %s" % (tarName, str(e))) + sys.exit(1) + if not isSource and checkHash: + md5Name = "%s-%s.md5" % (pkgName, pkgVer) + md5Path = os.path.join(cliParams.targetPath, md5Name) + md5FileURL = "%s/%s" % (tarsURL, md5Name) + md5CachePath = os.path.join(cacheDir, md5Name) + if cache and os.path.isfile(md5CachePath): + logNOTICE("Using cached copy of %s" % md5Name) + shutil.copy(md5CachePath, md5Path) + else: + logNOTICE("Retrieving %s" % md5FileURL) + try: + if not urlretrieveTimeout(md5FileURL, md5Path, 60): + logERROR("Cannot download %s" % tarName) + return False + except Exception as e: + logERROR("Cannot download %s: %s" % (md5Name, str(e))) + return False + # Read md5 + fd = open(os.path.join(cliParams.targetPath, md5Name), "r") + md5Expected = fd.read().strip() + fd.close() + # Calculate md5 + md5Calculated = hashlib.md5() + with open(os.path.join(cliParams.targetPath, tarName), "rb") as fd: + buf = fd.read(4096) + while buf: + md5Calculated.update(buf) + buf = fd.read(4096) + + # Check + if md5Expected != md5Calculated.hexdigest(): + logERROR("Oops... md5 for package %s failed!" % pkgVer) + sys.exit(1) + # Delete md5 file + if cache: + if not os.path.isdir(cacheDir): + os.makedirs(cacheDir) + os.rename(md5Path, md5CachePath) + else: + os.unlink(md5Path) + # Extract + # cwd = os.getcwd() + # os.chdir(cliParams.targetPath) + # tf = tarfile.open( tarPath, "r" ) + # for member in tf.getmembers(): + # tf.extract( member ) + # os.chdir(cwd) + if not isSource: + logNOTICE("Extract using system tar: %s" % tarPath) + tarCmd = "tar xzf '%s' -C '%s'" % (tarPath, cliParams.targetPath) + if os.system(tarCmd): + logERROR("Extraction of tarball %s failed" % tarPath) + raise RuntimeError("Failed to extract tarball") + # Delete tar + if cache: + if not os.path.isdir(cacheDir): + os.makedirs(cacheDir) + os.rename(tarPath, tarCachePath) + else: + if tarPath != tarFileCVMFS: + os.unlink(tarPath) + + postInstallScript = os.path.join(cliParams.targetPath, pkgName, 'dirac-postInstall.py') + if os.path.isfile(postInstallScript): + os.chmod(postInstallScript, executablePerms) + logNOTICE("Executing %s..." % postInstallScript) + if os.system("python '%s' > '%s.out' 2> '%s.err'" % (postInstallScript, + postInstallScript, + postInstallScript)): + logERROR("Post installation script %s failed. Check %s.err" % (postInstallScript, + postInstallScript)) + return True + + +def fixBuildPaths(): + """ + At compilation time many scripts get the building directory inserted, + this needs to be changed to point to the current installation path: + cliParams.targetPath +""" + + # Locate build path (from header of pydoc) + binaryPath = os.path.join(cliParams.targetPath, cliParams.platform) + pydocPath = os.path.join(binaryPath, 'bin', 'pydoc') + try: + fd = open(pydocPath) + line = fd.readline() + fd.close() + buildPath = line[2:line.find(cliParams.platform) - 1] + replaceCmd = "grep -rIl '%s' %s | xargs sed -i'.org' 's:%s:%s:g'" % (buildPath, + binaryPath, + buildPath, + cliParams.targetPath) + os.system(replaceCmd) + + except BaseException: + pass + + +def fixPythonShebang(): + """ + Some scripts (like the gfal2 scripts) come with a shebang pointing to the system python. + We replace it with the environment one + """ + + binaryPath = os.path.join(cliParams.targetPath, cliParams.platform) + try: + replaceCmd = "grep -rIl '#!/usr/bin/python' %s/bin |\ + xargs sed -i'.org' 's:#!/usr/bin/python:#!/usr/bin/env python:g'" % binaryPath + os.system(replaceCmd) + except BaseException: + pass + + +def runExternalsPostInstall(): + """ + If there are any postInstall in externals, run them + """ + if cliParams.diracOS or cliParams.diracOSVersion: + postInstallPath = os.path.join(cliParams.targetPath, "postInstall") + else: + postInstallPath = os.path.join(cliParams.targetPath, cliParams.platform, "postInstall") + if not os.path.isdir(postInstallPath): + logDEBUG("There's no %s directory. Skipping postInstall step" % postInstallPath) + return + postInstallSuffix = "-postInstall" + for scriptName in os.listdir(postInstallPath): + if not scriptName.endswith(postInstallSuffix): + logDEBUG("%s does not have the %s suffix. Skipping.." % (scriptName, postInstallSuffix)) + continue + scriptPath = os.path.join(postInstallPath, scriptName) + os.chmod(scriptPath, executablePerms) + logNOTICE("Executing %s..." % scriptPath) + if os.system("'%s' > '%s.out' 2> '%s.err'" % (scriptPath, scriptPath, scriptPath)): + logERROR("Post installation script %s failed. Check %s.err" % (scriptPath, scriptPath)) + sys.exit(1) + + +def fixMySQLScript(): + """ + Update the mysql.server script (if installed) to point to the proper datadir + """ + scriptPath = os.path.join(cliParams.targetPath, 'scripts', 'dirac-fix-mysql-script') + bashrcFile = os.path.join(cliParams.targetPath, 'bashrc') + if cliParams.useVersionsDir: + bashrcFile = os.path.join(cliParams.basePath, 'bashrc') + command = 'source %s; %s > /dev/null' % (bashrcFile, scriptPath) + if os.path.exists(scriptPath): + logNOTICE("Executing %s..." % command) + os.system('bash -c "%s"' % command) + + +def checkPlatformAliasLink(): + """ + Make a link if there's an alias + """ + if cliParams.platform in platformAlias: + os.symlink(os.path.join(cliParams.targetPath, platformAlias[cliParams.platform]), + os.path.join(cliParams.targetPath, cliParams.platform)) + + +def installExternalRequirements(extType): + """ Install the extension requirements if any + """ + reqScript = os.path.join(cliParams.targetPath, "scripts", 'dirac-externals-requirements') + bashrcFile = os.path.join(cliParams.targetPath, 'bashrc') + if cliParams.useVersionsDir: + bashrcFile = os.path.join(cliParams.basePath, 'bashrc') + if os.path.isfile(reqScript): + os.chmod(reqScript, executablePerms) + logNOTICE("Executing %s..." % reqScript) + command = "%s -t '%s' > '%s.out' 2> '%s.err'" % (reqScript, extType, reqScript, reqScript) + if os.system('bash -c "source %s; %s"' % (bashrcFile, command)): + logERROR("Requirements installation script %s failed. Check %s.err" % (reqScript, + reqScript)) + return True + + +def discoverModules(modules): + """ + Created the dictionary which contains all modules, which can be installed + for example: {"DIRAC:{"sourceUrl":"https://github.com/zmathe/DIRAC.git","Vesrion:v6r20p11"}} + + :param: str modules: it contains meta information for the module, + which will be installed: https://github.com/zmathe/DIRAC.git:::DIRAC:::dev_main_branch + """ + + projects = {} + + for module in modules.split(","): + s = m = v = None + try: + s, m, v = module.split(":::") + except ValueError: + m = module.split(":::")[0] # the source and version is not provided + + projects[m] = {} + if s and v: + projects[m] = {"sourceUrl": s, "Version": v} + else: + logWARN('Unable to parse module: %s' % module) + return projects + +#### +# End of helper functions +#### + + +cmdOpts = (('r:', 'release=', 'Release version to install'), + ('l:', 'project=', 'Project to install'), + ('e:', 'extensions=', 'Extensions to install (comma separated)'), + ('t:', 'installType=', 'Installation type (client/server)'), + ('i:', 'pythonVersion=', 'Python version to compile (27/26)'), + ('p:', 'platform=', 'Platform to install'), + ('P:', 'installationPath=', 'Path where to install (default current working dir)'), + ('b', 'build', 'Force local compilation'), + ('g:', 'grid=', 'lcg tools package version'), + (' ', 'no-lcg-bundle', 'lcg tools not to be installed'), + ('B', 'noAutoBuild', 'Do not build if not available'), + ('v', 'useVersionsDir', 'Use versions directory'), + ('u:', 'baseURL=', "Use URL as the source for installation tarballs"), + ('d', 'debug', 'Show debug messages'), + ('V:', 'installation=', 'Installation from which to extract parameter values'), + ('X', 'externalsOnly', 'Only install external binaries'), + ('M:', 'defaultsURL=', 'Where to retrieve the global defaults from'), + ('h', 'help', 'Show this help'), + ('T:', 'Timeout=', 'Timeout for downloads (default = %s)'), + (' ', 'dirac-os-version=', 'the version of the DIRAC OS'), + (' ', 'dirac-os', 'Enable installation of DIRAC OS'), + (' ', 'tag=', 'release version to install from git, http or local'), + ('m:', 'module=', + 'Module to be installed. for example: -m DIRAC or -m git://github.com/DIRACGrid/DIRAC.git:DIRAC'), + ('x:', 'external=', 'external version'), + (' ', 'createLink', 'create version symbolic link from the versions directory. This is equivalent to the \ + following command: ln -s /opt/dirac/versions/vArBpC vArBpC'), + (' ', 'scriptSymlink', 'Symlink the scripts instead of creating wrapper'), + (' ', 'userEnvVariables=', + 'User-requested environment variables (comma-separated, name and value separated by ":::")') + ) + + +def usage(): + print("\nUsage:\n\n %s " % os.path.basename(sys.argv[0])) + print("\nOptions:") + for cmdOpt in cmdOpts: + print(" %s %s : %s" % (cmdOpt[0].ljust(3), cmdOpt[1].ljust(20), cmdOpt[2])) + print() + print("Known options and default values from /defaults section of releases file:") + for options in [('Release', cliParams.release), + ('Project', cliParams.project), + ('ModulesToInstall', []), + ('ExternalsType', cliParams.externalsType), + ('PythonVersion', cliParams.pythonVersion), + ('LcgVer', cliParams.lcgVer), + ('UseVersionsDir', cliParams.useVersionsDir), + ('BuildExternals', cliParams.buildExternals), + ('NoAutoBuild', cliParams.noAutoBuild), + ('Debug', cliParams.debug), + ('Timeout', cliParams.timeout)]: + print(" %s = %s" % options) + + sys.exit(0) + + +def loadConfiguration(): + """ + It loads the configuration file + """ + optList, args = getopt.getopt(sys.argv[1:], + "".join([opt[0] for opt in cmdOpts]), + [opt[1] for opt in cmdOpts]) + + # First check if the name is defined + for o, v in optList: + if o in ('-h', '--help'): + usage() + elif o in ('-V', '--installation'): + cliParams.installation = v + elif o in ("-d", "--debug"): + cliParams.debug = True + elif o in ("-M", "--defaultsURL"): + cliParams.globalDefaults = v + + releaseConfig = ReleaseConfig( + instName=cliParams.installation, + globalDefaultsURL=cliParams.globalDefaults) + if cliParams.debug: + releaseConfig.debugCB = logDEBUG + + result = releaseConfig.loadInstallationDefaults() + if not result['OK']: + logERROR("Could not load defaults: %s" % result['Message']) + + releaseConfig.loadInstallationLocalDefaults(args) + + for opName in ('release', 'externalsType', 'installType', 'pythonVersion', + 'buildExternals', 'noAutoBuild', 'debug', 'globalDefaults', + 'lcgVer', 'useVersionsDir', 'targetPath', + 'project', 'release', 'extensions', 'timeout'): + try: + opVal = releaseConfig.getInstallationConfig( + "LocalInstallation/%s" % (opName[0].upper() + opName[1:])) + except KeyError: + continue + + if opName == 'installType': + opName = 'externalsType' + + if isinstance(getattr(cliParams, opName), str_type): + setattr(cliParams, opName, opVal) + elif isinstance(getattr(cliParams, opName), bool): + setattr(cliParams, opName, opVal.lower() in ("y", "yes", "true", "1")) + elif isinstance(getattr(cliParams, opName), list): + setattr(cliParams, opName, [opV.strip() for opV in opVal.split(",") if opV]) + + # Now parse the ops + for o, v in optList: + if o in ('-r', '--release'): + cliParams.release = v + elif o in ('-l', '--project'): + cliParams.project = v + elif o in ('-e', '--extensions'): + for pkg in [p.strip() for p in v.split(",") if p.strip()]: + if pkg not in cliParams.extensions: + cliParams.extensions.append(pkg) + elif o in ('-t', '--installType'): + cliParams.externalsType = v + elif o in ('-i', '--pythonVersion'): + cliParams.pythonVersion = v + elif o in ('-p', '--platform'): + cliParams.platform = v + elif o in ('-d', '--debug'): + cliParams.debug = True + elif o in ('-g', '--grid'): + cliParams.lcgVer = v + elif o in ('--no-lcg-bundle'): + cliParams.noLcg = True + elif o in ('-u', '--baseURL'): + cliParams.installSource = v + elif o in ('-P', '--installationPath'): + cliParams.targetPath = v + try: + os.makedirs(v) + except BaseException: + pass + elif o in ('-v', '--useVersionsDir'): + cliParams.useVersionsDir = True + elif o in ('-b', '--build'): + cliParams.buildExternals = True + elif o in ("-B", '--noAutoBuild'): + cliParams.noAutoBuild = True + elif o in ('-X', '--externalsOnly'): + cliParams.externalsOnly = True + elif o in ('-T', '--Timeout'): + try: + cliParams.timeout = max(cliParams.timeout, int(v)) + cliParams.timeout = min(cliParams.timeout, 3600) + except ValueError: + pass + elif o == '--dirac-os-version': + cliParams.diracOSVersion = v + elif o == '--dirac-os': + cliParams.diracOS = True + elif o == '--tag': + cliParams.tag = v + elif o in ('-m', '--module'): + cliParams.modules = discoverModules(v) + elif o in ('-x', '--external'): + cliParams.externalVersion = v + elif o == '--createLink': + cliParams.createLink = True + elif o == '--scriptSymlink': + cliParams.scriptSymlink = True + elif o == '--userEnvVariables': + cliParams.userEnvVariables = dict(zip([name.split(':::')[0] for name in v.replace(' ', '').split(',')], + [value.split(':::')[1] for value in v.replace(' ', '').split(',')])) + + if not cliParams.release and not cliParams.modules: + logERROR("Missing release to install") + usage() + + cliParams.basePath = cliParams.targetPath + if cliParams.useVersionsDir: + # install under /versions/_ + cliParams.targetPath = os.path.join( + cliParams.targetPath, 'versions', '%s_%s' % (cliParams.release, int(time.time()))) + try: + os.makedirs(cliParams.targetPath) + except BaseException: + pass + + # If we are running an update, DIRACOS will be set in the environment + if not cliParams.diracOS and 'DIRACOS' in os.environ: + logWARN("Forcing to install DIRACOS, because it is already installed!") + cliParams.diracOS = True + + logNOTICE("Destination path for installation is %s" % cliParams.targetPath) + releaseConfig.projectName = cliParams.project + + result = releaseConfig.loadProjectRelease(cliParams.release, + project=cliParams.project, + sourceURL=cliParams.installSource) + if not result['OK']: + return result + + if not releaseConfig.isProjectLoaded("DIRAC"): + return S_ERROR("DIRAC is not depended by this installation. Aborting") + + # Reload the local configuration to ensure it takes prescience + releaseConfig.loadInstallationLocalDefaults(args) + + return S_OK(releaseConfig) + + +def compileExternals(extVersion): + """ + It is used to compile the external for a given platform + + :param str extVersion: the external version + """ + logNOTICE("Compiling externals %s" % extVersion) + buildCmd = os.path.join( + cliParams.targetPath, + "DIRAC", + "Core", + "scripts", + "dirac-compile-externals.py") + buildCmd = "%s -t '%s' -D '%s' -v '%s' -i '%s'" % (buildCmd, + cliParams.externalsType, + os.path.join( + cliParams.targetPath, + cliParams.platform), + extVersion, + cliParams.pythonVersion) + if os.system(buildCmd): + logERROR("Could not compile binaries") + return False + return True + + +def getPlatform(): + """ + It returns the platform, where this script is running using Platform.py + """ + platformPath = os.path.join(cliParams.targetPath, "DIRAC", "Core", "Utilities", "Platform.py") + try: + platFD = open(platformPath, "r") + except IOError: + logERROR("Cannot open Platform.py. Is DIRAC installed?") + return '' + + Platform = imp.load_module("Platform", platFD, platformPath, ("", "r", imp.PY_SOURCE)) + platFD.close() + return Platform.getPlatformString() + + +def installExternals(releaseConfig): + """ + It install the DIRAC external. The version of the external is provided by + the cmd or in the configuration file. + + :param object releaseConfig: + """ + if not releaseConfig: + externalsVersion = cliParams.externalVersion + else: + externalsVersion = releaseConfig.getExternalsVersion() + if not externalsVersion: + logERROR("No externals defined") + return False + + if not cliParams.platform: + cliParams.platform = getPlatform() + if not cliParams.platform: + return False + + if cliParams.installSource: + tarsURL = cliParams.installSource + else: + tarsURL = releaseConfig.getTarsLocation('DIRAC')['Value'] + + if cliParams.buildExternals: + compileExternals(externalsVersion) + else: + logDEBUG("Using platform: %s" % cliParams.platform) + extVer = "%s-%s-%s-python%s" % (cliParams.externalsType, externalsVersion, + cliParams.platform, cliParams.pythonVersion) + logDEBUG("Externals %s are to be installed" % extVer) + if not downloadAndExtractTarball(tarsURL, "Externals", extVer, cache=True): + return (not cliParams.noAutoBuild) and compileExternals(externalsVersion) + logNOTICE("Fixing externals paths...") + fixBuildPaths() + logNOTICE("Running externals post install...") + checkPlatformAliasLink() + return True + + +def installLCGutils(releaseConfig): + """ + DIRAC uses various tools from LCG area. This method install a given + lcg version. + :param object releaseConfig: the configuration file object (class ReleaseConfig) + """ + if not cliParams.platform: + cliParams.platform = getPlatform() + if not cliParams.platform: + return False + + if cliParams.installSource: + tarsURL = cliParams.installSource + else: + tarsURL = releaseConfig.getTarsLocation('DIRAC')['Value'] + + # lcg utils? + # LCG utils if required + if not releaseConfig: + lcgVer = cliParams.lcgVer + else: + lcgVer = releaseConfig.getLCGVersion(cliParams.lcgVer) + if lcgVer: + verString = "%s-%s-python%s" % (lcgVer, cliParams.platform, cliParams.pythonVersion) + # HACK: try to find a more elegant solution for the lcg bundles location + if not downloadAndExtractTarball(tarsURL + "/../lcgBundles", "DIRAC-lcg", verString, False, cache=True): + logERROR( + "\nThe requested LCG software version %s for the local operating system could not be downloaded." % + verString) + logERROR("Please, check the availability of the LCG software bindings for you \ + platform 'DIRAC-lcg-%s' \n in the repository %s/lcgBundles/." % + (verString, os.path.dirname(tarsURL))) + logERROR( + "\nIf you would like to skip the installation of the LCG software, redo the installation with \ + adding the option --no-lcg-bundle to the command line.") + return False + + logNOTICE("Fixing Python Shebang...") + fixPythonShebang() + return True + + +def createPermanentDirLinks(): + """ Create links to permanent directories from within the version directory + """ + if cliParams.useVersionsDir: + try: + # Directories + for directory in ['startup', 'runit', 'data', 'work', 'control', 'sbin', 'etc', 'webRoot']: + fake = os.path.join(cliParams.targetPath, directory) + real = os.path.join(cliParams.basePath, directory) + if not os.path.exists(real): + os.makedirs(real) + if os.path.exists(fake): + # Try to reproduce the directory structure to avoid lacking directories + fakeDirs = os.listdir(fake) + for fd in fakeDirs: + if os.path.isdir(os.path.join(fake, fd)): + if not os.path.exists(os.path.join(real, fd)): + os.makedirs(os.path.join(real, fd)) + os.rename(fake, fake + '.bak') + os.symlink(real, fake) + + # Files + for filename in ['bashrc']: + fake = os.path.join(cliParams.targetPath, filename) + real = os.path.join(cliParams.basePath, filename) + os.symlink(real, fake) + except Exception as x: + logERROR(str(x)) + return False + + return True + + +def createOldProLinks(): + """ Create links to permanent directories from within the version directory + """ + proPath = cliParams.targetPath + if cliParams.useVersionsDir: + oldPath = os.path.join(cliParams.basePath, 'old') + proPath = os.path.join(cliParams.basePath, 'pro') + try: + if os.path.exists(proPath) or os.path.islink(proPath): + if os.path.exists(oldPath) or os.path.islink(oldPath): + os.unlink(oldPath) + os.rename(proPath, oldPath) + os.symlink(cliParams.targetPath, proPath) + except Exception as x: + logERROR(str(x)) + return False + + return True + + +def createBashrc(): + """ Create DIRAC environment setting script for the bash shell + """ + + proPath = cliParams.targetPath + # Now create bashrc at basePath + try: + bashrcFile = os.path.join(cliParams.targetPath, 'bashrc') + if cliParams.useVersionsDir: + bashrcFile = os.path.join(cliParams.basePath, 'bashrc') + proPath = os.path.join(cliParams.basePath, 'pro') + logNOTICE('Creating %s' % bashrcFile) + if not os.path.exists(bashrcFile): + lines = ['# DIRAC bashrc file, used by service and agent run scripts to set environment', + 'export PYTHONUNBUFFERED=yes', + 'export PYTHONOPTIMIZE=x'] + if 'HOME' in os.environ: + lines.append('[ -z "$HOME" ] && export HOME=%s' % os.environ['HOME']) + + # Determining where the CAs are... + if 'X509_CERT_DIR' in os.environ: + certDir = os.environ['X509_CERT_DIR'] + else: + if os.path.isdir('/etc/grid-security/certificates') and \ + os.listdir('/etc/grid-security/certificates'): + # Assuming that, if present, it is not empty, and has correct CAs + certDir = '/etc/grid-security/certificates' + else: + # But this will have to be created at some point (dirac-configure) + certDir = '%s/etc/grid-security/certificates' % proPath + lines.extend(['# CAs path for SSL verification', + 'export X509_CERT_DIR=%s' % certDir, + 'export SSL_CERT_DIR=%s' % certDir]) + + lines.append( + 'export X509_VOMS_DIR=%s' % + os.path.join( + proPath, + 'etc', + 'grid-security', + 'vomsdir')) + lines.extend( + [ + '# Some DIRAC locations', + '[ -z "$DIRAC" ] && export DIRAC=%s' % + proPath, + 'export DIRACBIN=%s' % + os.path.join( + "$DIRAC", + cliParams.platform, + 'bin'), + 'export DIRACSCRIPTS=%s' % + os.path.join( + "$DIRAC", + 'scripts'), + 'export DIRACLIB=%s' % + os.path.join( + "$DIRAC", + cliParams.platform, + 'lib'), + 'export TERMINFO=%s' % + __getTerminfoLocations( + os.path.join( + "$DIRAC", + cliParams.platform, + 'share', + 'terminfo')), + 'export RRD_DEFAULT_FONT=%s' % + os.path.join( + "$DIRAC", + cliParams.platform, + 'share', + 'rrdtool', + 'fonts', + 'DejaVuSansMono-Roman.ttf')]) + + lines.extend(['# Prepend the PYTHONPATH, the LD_LIBRARY_PATH, and the DYLD_LIBRARY_PATH']) + lines.extend(['( echo $PATH | grep -q $DIRACBIN ) || export PATH=$DIRACBIN:$PATH', + '( echo $PATH | grep -q $DIRACSCRIPTS ) || export PATH=$DIRACSCRIPTS:$PATH', + '( echo $LD_LIBRARY_PATH | grep -q $DIRACLIB ) || \ + export LD_LIBRARY_PATH=$DIRACLIB:$LD_LIBRARY_PATH', + '( echo $LD_LIBRARY_PATH | grep -q $DIRACLIB/mysql ) || \ + export LD_LIBRARY_PATH=$DIRACLIB/mysql:$LD_LIBRARY_PATH', + '( echo $DYLD_LIBRARY_PATH | grep -q $DIRACLIB ) || \ + export DYLD_LIBRARY_PATH=$DIRACLIB:$DYLD_LIBRARY_PATH', + '( echo $DYLD_LIBRARY_PATH | grep -q $DIRACLIB/mysql ) || \ + export DYLD_LIBRARY_PATH=$DIRACLIB/mysql:$DYLD_LIBRARY_PATH']) + + lines.extend(['export PYTHONPATH=$DIRAC']) + + lines.extend(['# new OpenSSL version require OPENSSL_CONF to point to some accessible location', + 'export OPENSSL_CONF=/tmp']) + + # gfal2 requires some environment variables to be set + lines.extend(['# Gfal2 configuration and plugins', 'export GFAL_CONFIG_DIR=%s' % + os.path.join("$DIRAC", cliParams.platform, 'etc/gfal2.d'), 'export GFAL_PLUGIN_DIR=%s' % + os.path.join("$DIRACLIB", 'gfal2-plugins')]) + # add DIRACPLAT environment variable for client installations + if cliParams.externalsType == 'client': + lines.extend(['# DIRAC platform', + '[ -z "$DIRACPLAT" ] && export DIRACPLAT=`$DIRAC/scripts/dirac-platform`']) + # Add the lines required for globus-* tools to use IPv6 + lines.extend(['# IPv6 support', + 'export GLOBUS_IO_IPV6=TRUE', + 'export GLOBUS_FTP_CLIENT_IPV6=TRUE']) + # Add the lines required for ARC CE support + lines.extend(['# ARC Computing Element', + 'export ARC_PLUGIN_PATH=$DIRACLIB/arc']) + + # Add the lines required for fork support for xrootd + lines.extend(['# Fork support for xrootd', + 'export XRD_RUNFORKHANDLER=1']) + + # Add the lines required for further env variables requested + if cliParams.userEnvVariables: + lines.extend(['# User-requested variables']) + for envName, envValue in cliParams.userEnvVariables.items(): + lines.extend(['export %s=%s' % (envName, envValue)]) + + # Add possible DIRAC environment variables + lines.append('') + lines.append('# before enabling any of these variables, please see the documentation ') + lines.append('# https://dirac.readthedocs.io/en/latest/AdministratorGuide/' + + 'ServerInstallations/environment_variable_configuration.html') + lines.append('# export DIRAC_DEBUG_DENCODE_CALLSTACK=1') + lines.append('# export DIRAC_DEBUG_STOMP=1') + lines.append('# export DIRAC_DEPRECATED_FAIL=1') + lines.append('# export DIRAC_GFAL_GRIDFTP_SESSION_REUSE=true') + lines.append('# export DIRAC_USE_JSON_DECODE=no') + lines.append('# export DIRAC_USE_JSON_ENCODE=no') + lines.append('# export DIRAC_USE_M2CRYPTO=true') + lines.append('# export DIRAC_USE_NEWTHREADPOOL=yes') + lines.append('# export DIRAC_VOMSES=$DIRAC/etc/grid-security/vomses') + lines.append('# export DIRAC_NO_CFG=true') + lines.append('') + f = open(bashrcFile, 'w') + f.write('\n'.join(lines)) + f.close() + except Exception as x: + logERROR(str(x)) + return False + + return True + + +def createCshrc(): + """ Create DIRAC environment setting script for the (t)csh shell + """ + proPath = cliParams.targetPath + # Now create cshrc at basePath + try: + cshrcFile = os.path.join(cliParams.targetPath, 'cshrc') + if cliParams.useVersionsDir: + cshrcFile = os.path.join(cliParams.basePath, 'cshrc') + proPath = os.path.join(cliParams.basePath, 'pro') + logNOTICE('Creating %s' % cshrcFile) + if not os.path.exists(cshrcFile): + lines = ['# DIRAC cshrc file, used by clients to set up the environment', + 'setenv PYTHONUNBUFFERED yes', + 'setenv PYTHONOPTIMIZE x'] + + # Determining where the CAs are... + if 'X509_CERT_DIR' in os.environ: + certDir = os.environ['X509_CERT_DIR'] + else: + if os.path.isdir('/etc/grid-security/certificates') and \ + os.listdir('/etc/grid-security/certificates'): + # Assuming that, if present, it is not empty, and has correct CAs + certDir = '/etc/grid-security/certificates' + else: + # But this will have to be created at some point (dirac-configure) + certDir = '%s/etc/grid-security/certificates' % proPath + lines.extend(['# CAs path for SSL verification', + 'setenv X509_CERT_DIR %s' % certDir, + 'setenv SSL_CERT_DIR %s' % certDir]) + + lines.append( + 'setenv X509_VOMS_DIR %s' % + os.path.join( + proPath, + 'etc', + 'grid-security', + 'vomsdir')) + lines.extend(['# Some DIRAC locations', + '( test $?DIRAC -eq 1 ) || setenv DIRAC %s' % proPath, + 'setenv DIRACBIN %s' % os.path.join("$DIRAC", cliParams.platform, 'bin'), + 'setenv DIRACSCRIPTS %s' % os.path.join("$DIRAC", 'scripts'), + 'setenv DIRACLIB %s' % os.path.join("$DIRAC", cliParams.platform, 'lib'), + 'setenv TERMINFO %s' % __getTerminfoLocations(os.path.join("$DIRAC", + cliParams.platform, + 'share', + 'terminfo'))]) + + lines.extend(['# Prepend the PYTHONPATH, the LD_LIBRARY_PATH, and the DYLD_LIBRARY_PATH']) + + lines.extend(['( test $?PATH -eq 1 ) || setenv PATH ""', + '( test $?LD_LIBRARY_PATH -eq 1 ) || setenv LD_LIBRARY_PATH ""', + '( test $?DY_LD_LIBRARY_PATH -eq 1 ) || setenv DYLD_LIBRARY_PATH ""', + '( test $?PYTHONPATH -eq 1 ) || setenv PYTHONPATH ""', + '( echo $PATH | grep -q $DIRACBIN ) || setenv PATH ${DIRACBIN}:$PATH', + '( echo $PATH | grep -q $DIRACSCRIPTS ) || setenv PATH ${DIRACSCRIPTS}:$PATH', + '( echo $LD_LIBRARY_PATH | grep -q $DIRACLIB ) || \ + setenv LD_LIBRARY_PATH ${DIRACLIB}:$LD_LIBRARY_PATH', + '( echo $LD_LIBRARY_PATH | grep -q $DIRACLIB/mysql ) || \ + setenv LD_LIBRARY_PATH ${DIRACLIB}/mysql:$LD_LIBRARY_PATH', + '( echo $DYLD_LIBRARY_PATH | grep -q $DIRACLIB ) || \ + setenv DYLD_LIBRARY_PATH ${DIRACLIB}:$DYLD_LIBRARY_PATH', + '( echo $DYLD_LIBRARY_PATH | grep -q $DIRACLIB/mysql ) || \ + setenv DYLD_LIBRARY_PATH ${DIRACLIB}/mysql:$DYLD_LIBRARY_PATH']) + + lines.extend(['setenv PYTHONPATH ${DIRAC}']) + + lines.extend(['# new OpenSSL version require OPENSSL_CONF to point to some accessible location', + 'setenv OPENSSL_CONF /tmp']) + lines.extend(['# IPv6 support', + 'setenv GLOBUS_IO_IPV6 TRUE', + 'setenv GLOBUS_FTP_CLIENT_IPV6 TRUE']) + # gfal2 requires some environment variables to be set + lines.extend(['# Gfal2 configuration and plugins', 'setenv GFAL_CONFIG_DIR %s' % + os.path.join("$DIRAC", cliParams.platform, 'etc/gfal2.d'), 'setenv GFAL_PLUGIN_DIR %s' % + os.path.join("$DIRACLIB", 'gfal2-plugins')]) + # add DIRACPLAT environment variable for client installations + if cliParams.externalsType == 'client': + lines.extend(['# DIRAC platform', + 'test $?DIRACPLAT -eq 1 || setenv DIRACPLAT `$DIRAC/scripts/dirac-platform`']) + # Add the lines required for ARC CE support + lines.extend(['# ARC Computing Element', + 'setenv ARC_PLUGIN_PATH $DIRACLIB/arc']) + + # Add the lines required for fork support for xrootd + lines.extend(['# Fork support for xrootd', + 'setenv XRD_RUNFORKHANDLER 1']) + + # Add the lines required for further env variables requested + if cliParams.userEnvVariables: + lines.extend(['# User-requested variables']) + for envName, envValue in cliParams.userEnvVariables.items(): + lines.extend(['setenv %s %s' % (envName, envValue)]) + + lines.append('') + f = open(cshrcFile, 'w') + f.write('\n'.join(lines)) + f.close() + except Exception as x: + logERROR(str(x)) + return False + + return True + + +def writeDefaultConfiguration(): + """ + After DIRAC is installed a default configuration file is created, + which contains a minimal setup. + """ + if not releaseConfig: + return + instCFG = releaseConfig.getInstallationCFG() + if not instCFG: + return + for opName in instCFG.getOptions(): + instCFG.delPath(opName) + + # filePath = os.path.join( cliParams.targetPath, "defaults-%s.cfg" % cliParams.installation ) + # Keep the default configuration file in the working directory + filePath = "defaults-%s.cfg" % cliParams.installation + try: + fd = open(filePath, "w") + fd.write(instCFG.toString()) + fd.close() + except Exception as excp: + logERROR("Could not write %s: %s" % (filePath, excp)) + logNOTICE("Defaults written to %s" % filePath) + + +def __getTerminfoLocations(defaultLocation=None): + """returns the terminfo locations as a colon separated string""" + + terminfoLocations = [] + if defaultLocation: + terminfoLocations = [defaultLocation] + + for termpath in ['/usr/share/terminfo', '/etc/terminfo']: + if os.path.exists(termpath): + terminfoLocations.append(termpath) + + return ":".join(terminfoLocations) + + +def installDiracOS(releaseConfig): + """ + Install DIRAC OS. + + :param ReleaseConfig releaseConfig: The ReleaseConfig object for configuring the installation + """ + diracos, diracOSVersion = releaseConfig.getDiracOSVersion(cliParams.diracOSVersion) + if not diracOSVersion: + logERROR("No diracos defined") + return False + tarsURL = cliParams.installSource + if not tarsURL: + tarsURL = releaseConfig.getDiracOsLocation(useVanillaDiracOS=(diracos.lower() == 'diracos')) + if not tarsURL: + tarsURL = releaseConfig.getTarsLocation('DIRAC')['Value'] + logWARN("DIRACOS location is not specified using %s" % tarsURL) + if not downloadAndExtractTarball(tarsURL, diracos, diracOSVersion, cache=True): + return False + logNOTICE("Fixing externals paths...") + fixBuildPaths() + logNOTICE("Running externals post install...") + checkPlatformAliasLink() + return True + + +def installDiracOSPython3(releaseConfig): + """ + Install DIRAC OS for Python 3. + + :param ReleaseConfig releaseConfig: The ReleaseConfig object for configuring the installation + """ + url = "https://github.com/chrisburr/DIRACOS2/releases/latest/download/DIRACOS-Linux-x86_64.sh" + installerFn = os.path.join(cliParams.basePath, "DIRACOS-Linux-x86_64.sh") + if not urlretrieveTimeout(url, installerFn, cliParams.timeout): + raise Exception("Failed to download DIRACOS from " + url) + subprocess.check_call(["bash", installerFn, "-b", "-p", os.path.join(cliParams.basePath, "diracos")]) + return True + + +def createBashrcForDiracOS(): + """ Create DIRAC environment setting script for the bash shell + """ + + proPath = cliParams.targetPath + # Now create bashrc at basePath + try: + bashrcFile = os.path.join(cliParams.targetPath, 'bashrc') + if cliParams.useVersionsDir: + bashrcFile = os.path.join(cliParams.basePath, 'bashrc') + proPath = os.path.join(cliParams.basePath, 'pro') + logNOTICE('Creating %s' % bashrcFile) + if not os.path.exists(bashrcFile): + lines = ['# DIRAC bashrc file, used by service and agent run scripts to set environment', + 'export PYTHONUNBUFFERED=yes', + 'export PYTHONOPTIMIZE=x', + '[ -z "$DIRAC" ] && export DIRAC=%s' % proPath, + '[ -z "$DIRACOS" ] && export DIRACOS=$DIRAC/diracos', + '. $DIRACOS/diracosrc'] + if 'HOME' in os.environ: + lines.append('[ -z "$HOME" ] && export HOME=%s' % os.environ['HOME']) + + # Determining where the CAs are... + if 'X509_CERT_DIR' in os.environ: + certDir = os.environ['X509_CERT_DIR'] + else: + if os.path.isdir('/etc/grid-security/certificates') and \ + os.listdir('/etc/grid-security/certificates'): + # Assuming that, if present, it is not empty, and has correct CAs + certDir = '/etc/grid-security/certificates' + else: + # But this will have to be created at some point (dirac-configure) + certDir = '%s/etc/grid-security/certificates' % proPath + lines.extend(['# CAs path for SSL verification', + 'export X509_CERT_DIR=%s' % certDir, + 'export SSL_CERT_DIR=%s' % certDir]) + + lines.append( + 'export X509_VOMS_DIR=%s' % + os.path.join( + proPath, + 'etc', + 'grid-security', + 'vomsdir')) + lines.extend( + [ + '# Some DIRAC locations', + 'export DIRACSCRIPTS=%s' % + os.path.join( + "$DIRAC", + 'scripts')]) + + lines.extend(['# Prepend the PATH and set the PYTHONPATH']) + + lines.extend(['( echo $PATH | grep -q $DIRACSCRIPTS ) || export PATH=$DIRACSCRIPTS:$PATH']) + + lines.extend(['export PYTHONPATH=$DIRAC']) + + lines.extend(['# new OpenSSL version require OPENSSL_CONF to point to some accessible location', + 'export OPENSSL_CONF=/tmp']) + + # add DIRACPLAT environment variable for client installations + if cliParams.externalsType == 'client': + lines.extend(['# DIRAC platform', + '[ -z "$DIRACPLAT" ] && export DIRACPLAT=`$DIRAC/scripts/dirac-platform`']) + # Add the lines required for globus-* tools to use IPv6 + lines.extend(['# IPv6 support', + 'export GLOBUS_IO_IPV6=TRUE', + 'export GLOBUS_FTP_CLIENT_IPV6=TRUE']) + + # Add the lines required for fork support for xrootd + lines.extend(['# Fork support for xrootd', + 'export XRD_RUNFORKHANDLER=1']) + + # Add possible DIRAC environment variables + lines.append('') + lines.append('# before enabling any of these variables, please see the documentation ') + lines.append('# https://dirac.readthedocs.io/en/latest/AdministratorGuide/' + + 'ServerInstallations/environment_variable_configuration.html') + lines.append('# export DIRAC_DEBUG_DENCODE_CALLSTACK=1') + lines.append('# export DIRAC_DEBUG_STOMP=1') + lines.append('# export DIRAC_DEPRECATED_FAIL=1') + lines.append('# export DIRAC_GFAL_GRIDFTP_SESSION_REUSE=true') + lines.append('# export DIRAC_USE_JSON_DECODE=no') + lines.append('# export DIRAC_USE_JSON_ENCODE=no') + lines.append('# export DIRAC_USE_M2CRYPTO=true') + lines.append('# export DIRAC_USE_NEWTHREADPOOL=yes') + lines.append('# export DIRAC_VOMSES=$DIRAC/etc/grid-security/vomses') + + # Add the lines required for further env variables requested + if cliParams.userEnvVariables: + lines.extend(['# User-requested variables']) + for envName, envValue in cliParams.userEnvVariables.items(): + lines.extend(['export %s=%s' % (envName, envValue)]) + + lines.append('') + with open(bashrcFile, 'w') as f: + f.write('\n'.join(lines)) + except Exception as x: + logERROR(str(x)) + return False + + return True + + +def checkoutFromGit(moduleName, sourceURL, tagVersion, destinationDir=None): + """ + This method checkout a given tag from a git repository. + Note: we can checkout any project form a git repository. + + :param str moduleName: The name of the Module: for example: LHCbWebDIRAC + :param str sourceURL: The code repository: https://github.com/DIRACGrid/WebAppDIRAC.git + :param str tagVersion: the tag for example: v3r1p10 + + """ + + codeRepo = moduleName + 'Repo' + + fDirName = os.path.join(cliParams.targetPath, codeRepo) + if os.path.isdir(sourceURL): + logNOTICE("Using local copy for source: %s" % sourceURL) + shutil.copytree(sourceURL, fDirName) + else: + cmd = "git clone '%s' '%s'" % (sourceURL, fDirName) + + logNOTICE("Executing: %s" % cmd) + if os.system(cmd): + return S_ERROR("Error while retrieving sources from git") + + branchName = "%s-%s" % (tagVersion, os.getpid()) + + isTagCmd = "( cd '%s'; git tag -l | grep '%s' )" % (fDirName, tagVersion) + if os.system(isTagCmd): + # No tag found, assume branch + branchSource = 'origin/%s' % tagVersion + else: + branchSource = tagVersion + + cmd = "( cd '%s'; git checkout -b '%s' '%s' )" % (fDirName, branchName, branchSource) + + logNOTICE("Executing: %s" % cmd) + exportRes = os.system(cmd) + + if exportRes: + return S_ERROR("Error while exporting from git") + + # replacing the code + if os.path.exists(fDirName + '/' + moduleName): + cmd = "ln -s %s/%s %s" % (codeRepo, moduleName, os.path.join(cliParams.targetPath, moduleName)) + else: + cmd = "mv %s %s" % (fDirName, os.path.join(cliParams.targetPath, moduleName)) + logNOTICE("Executing: %s" % cmd) + retVal = os.system(cmd) + + if retVal: + return S_ERROR("Error while creating module: %s" % (moduleName)) + + return S_OK() + + +def createSymbolicLink(): + """ + It creates a symbolic link to the actual directory from versions + directory. + """ + + cmd = "ln -s %s %s" % (cliParams.targetPath, cliParams.release) + logNOTICE("Executing: %s" % cmd) + retVal = os.system(cmd) + if retVal: + return S_ERROR("Error while creating symbolic link!") + + return S_OK() + + +if __name__ == "__main__": + logNOTICE("Processing installation requirements") + result = loadConfiguration() + releaseConfig = None + modsToInstall = {} + modsOrder = [] + if not result['OK']: + # the configuration files does not exists, which means the module is not released. + if cliParams.modules: + logNOTICE(str(cliParams.modules)) + for i in cliParams.modules: + modsOrder.append(i) + modsToInstall[i] = (cliParams.modules[i]['sourceUrl'], cliParams.modules[i]['Version']) + else: + # there is no module provided which can be deployed + logERROR(result['Message']) + sys.exit(1) + else: + releaseConfig = result['Value'] + if not createPermanentDirLinks(): + sys.exit(1) + + if not cliParams.externalsOnly: + logNOTICE("Discovering modules to install") + if releaseConfig: + result = releaseConfig.getModulesToInstall(cliParams.release, cliParams.extensions) + if not result['OK']: + logERROR(result['Message']) + sys.exit(1) + modsOrder, modsToInstall = result['Value'] + if cliParams.debug and releaseConfig: + logNOTICE("Writing down the releases files") + releaseConfig.dumpReleasesToPath() + logNOTICE("Installing modules...") + for modName in set(modsOrder): + tarsURL, modVersion = modsToInstall[modName] + if cliParams.installSource and not cliParams.modules: + # we install not release version of DIRAC + tarsURL = cliParams.installSource + if modName in cliParams.modules: + sourceURL = cliParams.modules[modName].get('sourceUrl') + if 'Version' in cliParams.modules[modName]: + modVersion = cliParams.modules[modName]['Version'] + if not sourceURL: + retVal = releaseConfig.getModSource(cliParams.release, modName) + if retVal['OK']: + tarsURL = retVal['Value'][1] # this is the git repository url + modVersion = cliParams.tag + else: + tarsURL = sourceURL + retVal = checkoutFromGit(modName, tarsURL, modVersion) + if not retVal['OK']: + logERROR("Cannot checkout %s" % retVal['Message']) + sys.exit(1) + else: + logNOTICE("Installing %s:%s" % (modName, modVersion)) + if not downloadAndExtractTarball(tarsURL, modName, modVersion): + sys.exit(1) + logNOTICE("Deploying scripts...") + ddeLocation = os.path.join(cliParams.targetPath, "DIRAC", "Core", + "scripts", "dirac-deploy-scripts.py") + if not os.path.isfile(ddeLocation): + ddeLocation = os.path.join(cliParams.targetPath, "DIRAC", "Core", + "scripts", "dirac_deploy_scripts.py") + if os.path.isfile(ddeLocation): + cmd = ddeLocation + + # if specified, create symlink instead of wrapper. + if cliParams.scriptSymlink: + cmd += ' --symlink' + + # In MacOS /usr/bin/env does not find python in the $PATH, passing binary path + # as an argument to the dirac-deploy-scripts + if not cliParams.platform: + cliParams.platform = getPlatform() + if "Darwin" in cliParams.platform: + binaryPath = os.path.join(cliParams.targetPath, cliParams.platform) + logNOTICE("For MacOS (Darwin) use explicit binary path %s" % binaryPath) + cmd += ' %s' % binaryPath + + os.system(cmd) + else: + logDEBUG("No dirac-deploy-scripts found. This doesn't look good") + else: + logNOTICE("Skipping installing DIRAC") + + # we install with DIRACOS from v7rX DIRAC release + if cliParams.diracOS \ + or list(releaseConfig.prjRelCFG['DIRAC'])[0][1] not in '0123456789' \ + or int(list(releaseConfig.prjRelCFG['DIRAC'])[0][1]) > 6: + logNOTICE("Installing DIRAC OS %s..." % cliParams.diracOSVersion) + if cliParams.pythonVersion.startswith("3"): + if not installDiracOSPython3(releaseConfig): + sys.exit(1) + else: + if not installDiracOS(releaseConfig): + sys.exit(1) + if not createBashrcForDiracOS(): + sys.exit(1) + else: + logNOTICE("Installing %s externals..." % cliParams.externalsType) + if not installExternals(releaseConfig): + sys.exit(1) + if cliParams.noLcg: + logNOTICE("Skipping installation of LCG software...") + else: + logNOTICE("Installing LCG software...") + if not installLCGutils(releaseConfig): + sys.exit(1) + if not createBashrc(): + sys.exit(1) + if not createCshrc(): + sys.exit(1) + if not createOldProLinks(): + sys.exit(1) + runExternalsPostInstall() + writeDefaultConfiguration() + if cliParams.externalsType == "server": + fixMySQLScript() + installExternalRequirements(cliParams.externalsType) + if cliParams.createLink: + createSymbolicLink() + logNOTICE("%s properly installed" % cliParams.installation) + sys.exit(0) diff --git a/Core/scripts/dirac-platform.py b/src/DIRAC/Core/scripts/dirac-platform.py similarity index 100% rename from Core/scripts/dirac-platform.py rename to src/DIRAC/Core/scripts/dirac-platform.py diff --git a/Core/scripts/dirac-service.py b/src/DIRAC/Core/scripts/dirac-service.py similarity index 100% rename from Core/scripts/dirac-service.py rename to src/DIRAC/Core/scripts/dirac-service.py diff --git a/Core/scripts/dirac-setup-site.py b/src/DIRAC/Core/scripts/dirac-setup-site.py similarity index 100% rename from Core/scripts/dirac-setup-site.py rename to src/DIRAC/Core/scripts/dirac-setup-site.py diff --git a/Core/scripts/dirac-version.py b/src/DIRAC/Core/scripts/dirac-version.py similarity index 100% rename from Core/scripts/dirac-version.py rename to src/DIRAC/Core/scripts/dirac-version.py diff --git a/Core/scripts/genAllCAs.sh b/src/DIRAC/Core/scripts/genAllCAs.sh similarity index 100% rename from Core/scripts/genAllCAs.sh rename to src/DIRAC/Core/scripts/genAllCAs.sh diff --git a/Core/scripts/genRevokedCerts.sh b/src/DIRAC/Core/scripts/genRevokedCerts.sh similarity index 100% rename from Core/scripts/genRevokedCerts.sh rename to src/DIRAC/Core/scripts/genRevokedCerts.sh diff --git a/Core/scripts/install_full.cfg b/src/DIRAC/Core/scripts/install_full.cfg similarity index 100% rename from Core/scripts/install_full.cfg rename to src/DIRAC/Core/scripts/install_full.cfg diff --git a/Core/scripts/install_minimal.cfg b/src/DIRAC/Core/scripts/install_minimal.cfg similarity index 100% rename from Core/scripts/install_minimal.cfg rename to src/DIRAC/Core/scripts/install_minimal.cfg diff --git a/Core/scripts/install_secondary.cfg b/src/DIRAC/Core/scripts/install_secondary.cfg similarity index 100% rename from Core/scripts/install_secondary.cfg rename to src/DIRAC/Core/scripts/install_secondary.cfg diff --git a/Core/scripts/install_site.sh b/src/DIRAC/Core/scripts/install_site.sh similarity index 100% rename from Core/scripts/install_site.sh rename to src/DIRAC/Core/scripts/install_site.sh diff --git a/Core/test/Test_API.py b/src/DIRAC/Core/test/Test_API.py similarity index 100% rename from Core/test/Test_API.py rename to src/DIRAC/Core/test/Test_API.py diff --git a/DataManagementSystem/Agent/FTS3Agent.py b/src/DIRAC/DataManagementSystem/Agent/FTS3Agent.py similarity index 100% rename from DataManagementSystem/Agent/FTS3Agent.py rename to src/DIRAC/DataManagementSystem/Agent/FTS3Agent.py diff --git a/DataManagementSystem/Agent/RequestOperations/ArchiveFiles.py b/src/DIRAC/DataManagementSystem/Agent/RequestOperations/ArchiveFiles.py similarity index 100% rename from DataManagementSystem/Agent/RequestOperations/ArchiveFiles.py rename to src/DIRAC/DataManagementSystem/Agent/RequestOperations/ArchiveFiles.py diff --git a/DataManagementSystem/Agent/RequestOperations/CheckMigration.py b/src/DIRAC/DataManagementSystem/Agent/RequestOperations/CheckMigration.py similarity index 100% rename from DataManagementSystem/Agent/RequestOperations/CheckMigration.py rename to src/DIRAC/DataManagementSystem/Agent/RequestOperations/CheckMigration.py diff --git a/DataManagementSystem/Agent/RequestOperations/DMSRequestOperationsBase.py b/src/DIRAC/DataManagementSystem/Agent/RequestOperations/DMSRequestOperationsBase.py similarity index 100% rename from DataManagementSystem/Agent/RequestOperations/DMSRequestOperationsBase.py rename to src/DIRAC/DataManagementSystem/Agent/RequestOperations/DMSRequestOperationsBase.py diff --git a/DataManagementSystem/Agent/RequestOperations/MoveReplica.py b/src/DIRAC/DataManagementSystem/Agent/RequestOperations/MoveReplica.py similarity index 100% rename from DataManagementSystem/Agent/RequestOperations/MoveReplica.py rename to src/DIRAC/DataManagementSystem/Agent/RequestOperations/MoveReplica.py diff --git a/DataManagementSystem/Agent/RequestOperations/PhysicalRemoval.py b/src/DIRAC/DataManagementSystem/Agent/RequestOperations/PhysicalRemoval.py similarity index 100% rename from DataManagementSystem/Agent/RequestOperations/PhysicalRemoval.py rename to src/DIRAC/DataManagementSystem/Agent/RequestOperations/PhysicalRemoval.py diff --git a/DataManagementSystem/Agent/RequestOperations/PutAndRegister.py b/src/DIRAC/DataManagementSystem/Agent/RequestOperations/PutAndRegister.py similarity index 100% rename from DataManagementSystem/Agent/RequestOperations/PutAndRegister.py rename to src/DIRAC/DataManagementSystem/Agent/RequestOperations/PutAndRegister.py diff --git a/DataManagementSystem/Agent/RequestOperations/ReTransfer.py b/src/DIRAC/DataManagementSystem/Agent/RequestOperations/ReTransfer.py similarity index 100% rename from DataManagementSystem/Agent/RequestOperations/ReTransfer.py rename to src/DIRAC/DataManagementSystem/Agent/RequestOperations/ReTransfer.py diff --git a/DataManagementSystem/Agent/RequestOperations/RegisterFile.py b/src/DIRAC/DataManagementSystem/Agent/RequestOperations/RegisterFile.py similarity index 100% rename from DataManagementSystem/Agent/RequestOperations/RegisterFile.py rename to src/DIRAC/DataManagementSystem/Agent/RequestOperations/RegisterFile.py diff --git a/DataManagementSystem/Agent/RequestOperations/RegisterReplica.py b/src/DIRAC/DataManagementSystem/Agent/RequestOperations/RegisterReplica.py similarity index 100% rename from DataManagementSystem/Agent/RequestOperations/RegisterReplica.py rename to src/DIRAC/DataManagementSystem/Agent/RequestOperations/RegisterReplica.py diff --git a/DataManagementSystem/Agent/RequestOperations/RemoveFile.py b/src/DIRAC/DataManagementSystem/Agent/RequestOperations/RemoveFile.py similarity index 100% rename from DataManagementSystem/Agent/RequestOperations/RemoveFile.py rename to src/DIRAC/DataManagementSystem/Agent/RequestOperations/RemoveFile.py diff --git a/DataManagementSystem/Agent/RequestOperations/RemoveReplica.py b/src/DIRAC/DataManagementSystem/Agent/RequestOperations/RemoveReplica.py similarity index 100% rename from DataManagementSystem/Agent/RequestOperations/RemoveReplica.py rename to src/DIRAC/DataManagementSystem/Agent/RequestOperations/RemoveReplica.py diff --git a/DataManagementSystem/Agent/RequestOperations/ReplicateAndRegister.py b/src/DIRAC/DataManagementSystem/Agent/RequestOperations/ReplicateAndRegister.py similarity index 100% rename from DataManagementSystem/Agent/RequestOperations/ReplicateAndRegister.py rename to src/DIRAC/DataManagementSystem/Agent/RequestOperations/ReplicateAndRegister.py diff --git a/DataManagementSystem/Agent/RequestOperations/StagingCallback.py b/src/DIRAC/DataManagementSystem/Agent/RequestOperations/StagingCallback.py similarity index 100% rename from DataManagementSystem/Agent/RequestOperations/StagingCallback.py rename to src/DIRAC/DataManagementSystem/Agent/RequestOperations/StagingCallback.py diff --git a/DataManagementSystem/Agent/RequestOperations/__init__.py b/src/DIRAC/DataManagementSystem/Agent/RequestOperations/__init__.py similarity index 100% rename from DataManagementSystem/Agent/RequestOperations/__init__.py rename to src/DIRAC/DataManagementSystem/Agent/RequestOperations/__init__.py diff --git a/DataManagementSystem/Agent/RequestOperations/test/Test_ArchiveFiles.py b/src/DIRAC/DataManagementSystem/Agent/RequestOperations/test/Test_ArchiveFiles.py similarity index 100% rename from DataManagementSystem/Agent/RequestOperations/test/Test_ArchiveFiles.py rename to src/DIRAC/DataManagementSystem/Agent/RequestOperations/test/Test_ArchiveFiles.py diff --git a/DataManagementSystem/Agent/RequestOperations/test/Test_CheckMigration.py b/src/DIRAC/DataManagementSystem/Agent/RequestOperations/test/Test_CheckMigration.py similarity index 100% rename from DataManagementSystem/Agent/RequestOperations/test/Test_CheckMigration.py rename to src/DIRAC/DataManagementSystem/Agent/RequestOperations/test/Test_CheckMigration.py diff --git a/DataManagementSystem/Agent/RequestOperations/test/Test_RequestOperations.py b/src/DIRAC/DataManagementSystem/Agent/RequestOperations/test/Test_RequestOperations.py similarity index 100% rename from DataManagementSystem/Agent/RequestOperations/test/Test_RequestOperations.py rename to src/DIRAC/DataManagementSystem/Agent/RequestOperations/test/Test_RequestOperations.py diff --git a/DataManagementSystem/Agent/__init__.py b/src/DIRAC/DataManagementSystem/Agent/__init__.py similarity index 100% rename from DataManagementSystem/Agent/__init__.py rename to src/DIRAC/DataManagementSystem/Agent/__init__.py diff --git a/DataManagementSystem/Client/CmdDirCompletion/AbstractFileSystem.py b/src/DIRAC/DataManagementSystem/Client/CmdDirCompletion/AbstractFileSystem.py similarity index 100% rename from DataManagementSystem/Client/CmdDirCompletion/AbstractFileSystem.py rename to src/DIRAC/DataManagementSystem/Client/CmdDirCompletion/AbstractFileSystem.py diff --git a/DataManagementSystem/Client/CmdDirCompletion/DirectoryCompletion.py b/src/DIRAC/DataManagementSystem/Client/CmdDirCompletion/DirectoryCompletion.py similarity index 100% rename from DataManagementSystem/Client/CmdDirCompletion/DirectoryCompletion.py rename to src/DIRAC/DataManagementSystem/Client/CmdDirCompletion/DirectoryCompletion.py diff --git a/DataManagementSystem/Client/CmdDirCompletion/__init__.py b/src/DIRAC/DataManagementSystem/Client/CmdDirCompletion/__init__.py similarity index 100% rename from DataManagementSystem/Client/CmdDirCompletion/__init__.py rename to src/DIRAC/DataManagementSystem/Client/CmdDirCompletion/__init__.py diff --git a/DataManagementSystem/Client/ConsistencyInspector.py b/src/DIRAC/DataManagementSystem/Client/ConsistencyInspector.py similarity index 100% rename from DataManagementSystem/Client/ConsistencyInspector.py rename to src/DIRAC/DataManagementSystem/Client/ConsistencyInspector.py diff --git a/DataManagementSystem/Client/DataIntegrityClient.py b/src/DIRAC/DataManagementSystem/Client/DataIntegrityClient.py similarity index 100% rename from DataManagementSystem/Client/DataIntegrityClient.py rename to src/DIRAC/DataManagementSystem/Client/DataIntegrityClient.py diff --git a/DataManagementSystem/Client/DataManager.py b/src/DIRAC/DataManagementSystem/Client/DataManager.py similarity index 100% rename from DataManagementSystem/Client/DataManager.py rename to src/DIRAC/DataManagementSystem/Client/DataManager.py diff --git a/DataManagementSystem/Client/DirectoryListing.py b/src/DIRAC/DataManagementSystem/Client/DirectoryListing.py similarity index 100% rename from DataManagementSystem/Client/DirectoryListing.py rename to src/DIRAC/DataManagementSystem/Client/DirectoryListing.py diff --git a/DataManagementSystem/Client/FTS3Client.py b/src/DIRAC/DataManagementSystem/Client/FTS3Client.py similarity index 100% rename from DataManagementSystem/Client/FTS3Client.py rename to src/DIRAC/DataManagementSystem/Client/FTS3Client.py diff --git a/DataManagementSystem/Client/FTS3File.py b/src/DIRAC/DataManagementSystem/Client/FTS3File.py similarity index 100% rename from DataManagementSystem/Client/FTS3File.py rename to src/DIRAC/DataManagementSystem/Client/FTS3File.py diff --git a/DataManagementSystem/Client/FTS3Job.py b/src/DIRAC/DataManagementSystem/Client/FTS3Job.py similarity index 100% rename from DataManagementSystem/Client/FTS3Job.py rename to src/DIRAC/DataManagementSystem/Client/FTS3Job.py diff --git a/DataManagementSystem/Client/FTS3Operation.py b/src/DIRAC/DataManagementSystem/Client/FTS3Operation.py similarity index 100% rename from DataManagementSystem/Client/FTS3Operation.py rename to src/DIRAC/DataManagementSystem/Client/FTS3Operation.py diff --git a/DataManagementSystem/Client/FailoverTransfer.py b/src/DIRAC/DataManagementSystem/Client/FailoverTransfer.py similarity index 100% rename from DataManagementSystem/Client/FailoverTransfer.py rename to src/DIRAC/DataManagementSystem/Client/FailoverTransfer.py diff --git a/DataManagementSystem/Client/FileCatalogClientCLI.py b/src/DIRAC/DataManagementSystem/Client/FileCatalogClientCLI.py similarity index 100% rename from DataManagementSystem/Client/FileCatalogClientCLI.py rename to src/DIRAC/DataManagementSystem/Client/FileCatalogClientCLI.py diff --git a/DataManagementSystem/Client/MetaQuery.py b/src/DIRAC/DataManagementSystem/Client/MetaQuery.py similarity index 100% rename from DataManagementSystem/Client/MetaQuery.py rename to src/DIRAC/DataManagementSystem/Client/MetaQuery.py diff --git a/DataManagementSystem/Client/S3GatewayClient.py b/src/DIRAC/DataManagementSystem/Client/S3GatewayClient.py similarity index 100% rename from DataManagementSystem/Client/S3GatewayClient.py rename to src/DIRAC/DataManagementSystem/Client/S3GatewayClient.py diff --git a/DataManagementSystem/Client/__init__.py b/src/DIRAC/DataManagementSystem/Client/__init__.py similarity index 100% rename from DataManagementSystem/Client/__init__.py rename to src/DIRAC/DataManagementSystem/Client/__init__.py diff --git a/DataManagementSystem/Client/test/Test_Client_DataManagementSystem.py b/src/DIRAC/DataManagementSystem/Client/test/Test_Client_DataManagementSystem.py similarity index 100% rename from DataManagementSystem/Client/test/Test_Client_DataManagementSystem.py rename to src/DIRAC/DataManagementSystem/Client/test/Test_Client_DataManagementSystem.py diff --git a/DataManagementSystem/Client/test/__init__.py b/src/DIRAC/DataManagementSystem/Client/test/__init__.py similarity index 100% rename from DataManagementSystem/Client/test/__init__.py rename to src/DIRAC/DataManagementSystem/Client/test/__init__.py diff --git a/DataManagementSystem/Client/test/mock_DM.py b/src/DIRAC/DataManagementSystem/Client/test/mock_DM.py similarity index 100% rename from DataManagementSystem/Client/test/mock_DM.py rename to src/DIRAC/DataManagementSystem/Client/test/mock_DM.py diff --git a/DataManagementSystem/Client/test/new_dir_completion.py b/src/DIRAC/DataManagementSystem/Client/test/new_dir_completion.py similarity index 100% rename from DataManagementSystem/Client/test/new_dir_completion.py rename to src/DIRAC/DataManagementSystem/Client/test/new_dir_completion.py diff --git a/DataManagementSystem/ConfigTemplate.cfg b/src/DIRAC/DataManagementSystem/ConfigTemplate.cfg similarity index 100% rename from DataManagementSystem/ConfigTemplate.cfg rename to src/DIRAC/DataManagementSystem/ConfigTemplate.cfg diff --git a/DataManagementSystem/DB/DataIntegrityDB.py b/src/DIRAC/DataManagementSystem/DB/DataIntegrityDB.py similarity index 100% rename from DataManagementSystem/DB/DataIntegrityDB.py rename to src/DIRAC/DataManagementSystem/DB/DataIntegrityDB.py diff --git a/DataManagementSystem/DB/DataIntegrityDB.sql b/src/DIRAC/DataManagementSystem/DB/DataIntegrityDB.sql similarity index 100% rename from DataManagementSystem/DB/DataIntegrityDB.sql rename to src/DIRAC/DataManagementSystem/DB/DataIntegrityDB.sql diff --git a/DataManagementSystem/DB/FTS3DB.py b/src/DIRAC/DataManagementSystem/DB/FTS3DB.py similarity index 100% rename from DataManagementSystem/DB/FTS3DB.py rename to src/DIRAC/DataManagementSystem/DB/FTS3DB.py diff --git a/DataManagementSystem/DB/FTS3DB.sql b/src/DIRAC/DataManagementSystem/DB/FTS3DB.sql similarity index 100% rename from DataManagementSystem/DB/FTS3DB.sql rename to src/DIRAC/DataManagementSystem/DB/FTS3DB.sql diff --git a/DataManagementSystem/DB/FileCatalogComponents/DatasetManager/DatasetManager.py b/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/DatasetManager/DatasetManager.py similarity index 100% rename from DataManagementSystem/DB/FileCatalogComponents/DatasetManager/DatasetManager.py rename to src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/DatasetManager/DatasetManager.py diff --git a/DataManagementSystem/DB/FileCatalogComponents/DatasetManager/__init__.py b/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/DatasetManager/__init__.py similarity index 100% rename from DataManagementSystem/DB/FileCatalogComponents/DatasetManager/__init__.py rename to src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/DatasetManager/__init__.py diff --git a/DataManagementSystem/DB/FileCatalogComponents/DirectoryManager/DirectoryClosure.py b/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/DirectoryManager/DirectoryClosure.py similarity index 100% rename from DataManagementSystem/DB/FileCatalogComponents/DirectoryManager/DirectoryClosure.py rename to src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/DirectoryManager/DirectoryClosure.py diff --git a/DataManagementSystem/DB/FileCatalogComponents/DirectoryManager/DirectoryFlatTree.py b/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/DirectoryManager/DirectoryFlatTree.py similarity index 100% rename from DataManagementSystem/DB/FileCatalogComponents/DirectoryManager/DirectoryFlatTree.py rename to src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/DirectoryManager/DirectoryFlatTree.py diff --git a/DataManagementSystem/DB/FileCatalogComponents/DirectoryManager/DirectoryLevelTree.py b/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/DirectoryManager/DirectoryLevelTree.py similarity index 100% rename from DataManagementSystem/DB/FileCatalogComponents/DirectoryManager/DirectoryLevelTree.py rename to src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/DirectoryManager/DirectoryLevelTree.py diff --git a/DataManagementSystem/DB/FileCatalogComponents/DirectoryManager/DirectoryNodeTree.py b/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/DirectoryManager/DirectoryNodeTree.py similarity index 100% rename from DataManagementSystem/DB/FileCatalogComponents/DirectoryManager/DirectoryNodeTree.py rename to src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/DirectoryManager/DirectoryNodeTree.py diff --git a/DataManagementSystem/DB/FileCatalogComponents/DirectoryManager/DirectorySimpleTree.py b/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/DirectoryManager/DirectorySimpleTree.py similarity index 100% rename from DataManagementSystem/DB/FileCatalogComponents/DirectoryManager/DirectorySimpleTree.py rename to src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/DirectoryManager/DirectorySimpleTree.py diff --git a/DataManagementSystem/DB/FileCatalogComponents/DirectoryManager/DirectoryTreeBase.py b/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/DirectoryManager/DirectoryTreeBase.py similarity index 100% rename from DataManagementSystem/DB/FileCatalogComponents/DirectoryManager/DirectoryTreeBase.py rename to src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/DirectoryManager/DirectoryTreeBase.py diff --git a/DataManagementSystem/DB/FileCatalogComponents/DirectoryManager/__init__.py b/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/DirectoryManager/__init__.py similarity index 100% rename from DataManagementSystem/DB/FileCatalogComponents/DirectoryManager/__init__.py rename to src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/DirectoryManager/__init__.py diff --git a/DataManagementSystem/DB/FileCatalogComponents/DirectoryMetadata/DirectoryMetadata.py b/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/DirectoryMetadata/DirectoryMetadata.py similarity index 100% rename from DataManagementSystem/DB/FileCatalogComponents/DirectoryMetadata/DirectoryMetadata.py rename to src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/DirectoryMetadata/DirectoryMetadata.py diff --git a/DataManagementSystem/DB/FileCatalogComponents/DirectoryMetadata/MultiVODirectoryMetadata.py b/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/DirectoryMetadata/MultiVODirectoryMetadata.py similarity index 100% rename from DataManagementSystem/DB/FileCatalogComponents/DirectoryMetadata/MultiVODirectoryMetadata.py rename to src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/DirectoryMetadata/MultiVODirectoryMetadata.py diff --git a/DataManagementSystem/DB/FileCatalogComponents/DirectoryMetadata/__init__.py b/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/DirectoryMetadata/__init__.py similarity index 100% rename from DataManagementSystem/DB/FileCatalogComponents/DirectoryMetadata/__init__.py rename to src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/DirectoryMetadata/__init__.py diff --git a/DataManagementSystem/DB/FileCatalogComponents/FileManager/FileManager.py b/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/FileManager/FileManager.py similarity index 100% rename from DataManagementSystem/DB/FileCatalogComponents/FileManager/FileManager.py rename to src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/FileManager/FileManager.py diff --git a/DataManagementSystem/DB/FileCatalogComponents/FileManager/FileManagerBase.py b/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/FileManager/FileManagerBase.py similarity index 100% rename from DataManagementSystem/DB/FileCatalogComponents/FileManager/FileManagerBase.py rename to src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/FileManager/FileManagerBase.py diff --git a/DataManagementSystem/DB/FileCatalogComponents/FileManager/FileManagerFlat.py b/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/FileManager/FileManagerFlat.py similarity index 100% rename from DataManagementSystem/DB/FileCatalogComponents/FileManager/FileManagerFlat.py rename to src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/FileManager/FileManagerFlat.py diff --git a/DataManagementSystem/DB/FileCatalogComponents/FileManager/FileManagerPs.py b/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/FileManager/FileManagerPs.py similarity index 100% rename from DataManagementSystem/DB/FileCatalogComponents/FileManager/FileManagerPs.py rename to src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/FileManager/FileManagerPs.py diff --git a/DataManagementSystem/DB/FileCatalogComponents/FileManager/__init__.py b/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/FileManager/__init__.py similarity index 100% rename from DataManagementSystem/DB/FileCatalogComponents/FileManager/__init__.py rename to src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/FileManager/__init__.py diff --git a/DataManagementSystem/DB/FileCatalogComponents/FileMetadata/FileMetadata.py b/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/FileMetadata/FileMetadata.py similarity index 100% rename from DataManagementSystem/DB/FileCatalogComponents/FileMetadata/FileMetadata.py rename to src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/FileMetadata/FileMetadata.py diff --git a/DataManagementSystem/DB/FileCatalogComponents/FileMetadata/MultiVOFileMetadata.py b/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/FileMetadata/MultiVOFileMetadata.py similarity index 100% rename from DataManagementSystem/DB/FileCatalogComponents/FileMetadata/MultiVOFileMetadata.py rename to src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/FileMetadata/MultiVOFileMetadata.py diff --git a/DataManagementSystem/DB/FileCatalogComponents/FileMetadata/__init__.py b/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/FileMetadata/__init__.py similarity index 100% rename from DataManagementSystem/DB/FileCatalogComponents/FileMetadata/__init__.py rename to src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/FileMetadata/__init__.py diff --git a/DataManagementSystem/DB/FileCatalogComponents/SEManager/SEManagerBase.py b/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/SEManager/SEManagerBase.py similarity index 100% rename from DataManagementSystem/DB/FileCatalogComponents/SEManager/SEManagerBase.py rename to src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/SEManager/SEManagerBase.py diff --git a/DataManagementSystem/DB/FileCatalogComponents/SEManager/SEManagerDB.py b/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/SEManager/SEManagerDB.py similarity index 100% rename from DataManagementSystem/DB/FileCatalogComponents/SEManager/SEManagerDB.py rename to src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/SEManager/SEManagerDB.py diff --git a/DataManagementSystem/DB/FileCatalogComponents/SEManager/__init__.py b/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/SEManager/__init__.py similarity index 100% rename from DataManagementSystem/DB/FileCatalogComponents/SEManager/__init__.py rename to src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/SEManager/__init__.py diff --git a/DataManagementSystem/DB/FileCatalogComponents/SecurityManager/DirectorySecurityManager.py b/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/SecurityManager/DirectorySecurityManager.py similarity index 100% rename from DataManagementSystem/DB/FileCatalogComponents/SecurityManager/DirectorySecurityManager.py rename to src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/SecurityManager/DirectorySecurityManager.py diff --git a/DataManagementSystem/DB/FileCatalogComponents/SecurityManager/DirectorySecurityManagerWithDelete.py b/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/SecurityManager/DirectorySecurityManagerWithDelete.py similarity index 100% rename from DataManagementSystem/DB/FileCatalogComponents/SecurityManager/DirectorySecurityManagerWithDelete.py rename to src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/SecurityManager/DirectorySecurityManagerWithDelete.py diff --git a/DataManagementSystem/DB/FileCatalogComponents/SecurityManager/FullSecurityManager.py b/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/SecurityManager/FullSecurityManager.py similarity index 100% rename from DataManagementSystem/DB/FileCatalogComponents/SecurityManager/FullSecurityManager.py rename to src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/SecurityManager/FullSecurityManager.py diff --git a/DataManagementSystem/DB/FileCatalogComponents/SecurityManager/NoSecurityManager.py b/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/SecurityManager/NoSecurityManager.py similarity index 100% rename from DataManagementSystem/DB/FileCatalogComponents/SecurityManager/NoSecurityManager.py rename to src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/SecurityManager/NoSecurityManager.py diff --git a/DataManagementSystem/DB/FileCatalogComponents/SecurityManager/SecurityManagerBase.py b/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/SecurityManager/SecurityManagerBase.py similarity index 100% rename from DataManagementSystem/DB/FileCatalogComponents/SecurityManager/SecurityManagerBase.py rename to src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/SecurityManager/SecurityManagerBase.py diff --git a/DataManagementSystem/DB/FileCatalogComponents/SecurityManager/VOMSSecurityManager.py b/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/SecurityManager/VOMSSecurityManager.py similarity index 100% rename from DataManagementSystem/DB/FileCatalogComponents/SecurityManager/VOMSSecurityManager.py rename to src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/SecurityManager/VOMSSecurityManager.py diff --git a/DataManagementSystem/DB/FileCatalogComponents/SecurityManager/__init__.py b/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/SecurityManager/__init__.py similarity index 100% rename from DataManagementSystem/DB/FileCatalogComponents/SecurityManager/__init__.py rename to src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/SecurityManager/__init__.py diff --git a/DataManagementSystem/DB/FileCatalogComponents/SecurityManager/test/Test_VOMSSecurityManager.py b/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/SecurityManager/test/Test_VOMSSecurityManager.py similarity index 100% rename from DataManagementSystem/DB/FileCatalogComponents/SecurityManager/test/Test_VOMSSecurityManager.py rename to src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/SecurityManager/test/Test_VOMSSecurityManager.py diff --git a/DataManagementSystem/DB/FileCatalogComponents/UserGroupManager/UserAndGroupManagerBase.py b/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/UserGroupManager/UserAndGroupManagerBase.py similarity index 100% rename from DataManagementSystem/DB/FileCatalogComponents/UserGroupManager/UserAndGroupManagerBase.py rename to src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/UserGroupManager/UserAndGroupManagerBase.py diff --git a/DataManagementSystem/DB/FileCatalogComponents/UserGroupManager/UserAndGroupManagerCS.py b/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/UserGroupManager/UserAndGroupManagerCS.py similarity index 100% rename from DataManagementSystem/DB/FileCatalogComponents/UserGroupManager/UserAndGroupManagerCS.py rename to src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/UserGroupManager/UserAndGroupManagerCS.py diff --git a/DataManagementSystem/DB/FileCatalogComponents/UserGroupManager/UserAndGroupManagerDB.py b/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/UserGroupManager/UserAndGroupManagerDB.py similarity index 100% rename from DataManagementSystem/DB/FileCatalogComponents/UserGroupManager/UserAndGroupManagerDB.py rename to src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/UserGroupManager/UserAndGroupManagerDB.py diff --git a/DataManagementSystem/DB/FileCatalogComponents/UserGroupManager/__init__.py b/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/UserGroupManager/__init__.py similarity index 100% rename from DataManagementSystem/DB/FileCatalogComponents/UserGroupManager/__init__.py rename to src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/UserGroupManager/__init__.py diff --git a/DataManagementSystem/DB/FileCatalogComponents/Utilities.py b/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/Utilities.py similarity index 100% rename from DataManagementSystem/DB/FileCatalogComponents/Utilities.py rename to src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/Utilities.py diff --git a/DataManagementSystem/DB/FileCatalogComponents/__init__.py b/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/__init__.py similarity index 100% rename from DataManagementSystem/DB/FileCatalogComponents/__init__.py rename to src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/__init__.py diff --git a/DataManagementSystem/DB/FileCatalogComponents/test/Test_DataManagement_FileCatalogComponents.py b/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/test/Test_DataManagement_FileCatalogComponents.py similarity index 100% rename from DataManagementSystem/DB/FileCatalogComponents/test/Test_DataManagement_FileCatalogComponents.py rename to src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/test/Test_DataManagement_FileCatalogComponents.py diff --git a/DataManagementSystem/DB/FileCatalogDB.py b/src/DIRAC/DataManagementSystem/DB/FileCatalogDB.py similarity index 100% rename from DataManagementSystem/DB/FileCatalogDB.py rename to src/DIRAC/DataManagementSystem/DB/FileCatalogDB.py diff --git a/DataManagementSystem/DB/FileCatalogDB.sql b/src/DIRAC/DataManagementSystem/DB/FileCatalogDB.sql similarity index 100% rename from DataManagementSystem/DB/FileCatalogDB.sql rename to src/DIRAC/DataManagementSystem/DB/FileCatalogDB.sql diff --git a/DataManagementSystem/DB/FileCatalogWithFkAndPsDB.sql b/src/DIRAC/DataManagementSystem/DB/FileCatalogWithFkAndPsDB.sql similarity index 100% rename from DataManagementSystem/DB/FileCatalogWithFkAndPsDB.sql rename to src/DIRAC/DataManagementSystem/DB/FileCatalogWithFkAndPsDB.sql diff --git a/DataManagementSystem/DB/__init__.py b/src/DIRAC/DataManagementSystem/DB/__init__.py similarity index 100% rename from DataManagementSystem/DB/__init__.py rename to src/DIRAC/DataManagementSystem/DB/__init__.py diff --git a/DataManagementSystem/Service/DataIntegrityHandler.py b/src/DIRAC/DataManagementSystem/Service/DataIntegrityHandler.py similarity index 100% rename from DataManagementSystem/Service/DataIntegrityHandler.py rename to src/DIRAC/DataManagementSystem/Service/DataIntegrityHandler.py diff --git a/DataManagementSystem/Service/FTS3ManagerHandler.py b/src/DIRAC/DataManagementSystem/Service/FTS3ManagerHandler.py similarity index 100% rename from DataManagementSystem/Service/FTS3ManagerHandler.py rename to src/DIRAC/DataManagementSystem/Service/FTS3ManagerHandler.py diff --git a/DataManagementSystem/Service/FileCatalogHandler.py b/src/DIRAC/DataManagementSystem/Service/FileCatalogHandler.py similarity index 100% rename from DataManagementSystem/Service/FileCatalogHandler.py rename to src/DIRAC/DataManagementSystem/Service/FileCatalogHandler.py diff --git a/DataManagementSystem/Service/FileCatalogProxyHandler.py b/src/DIRAC/DataManagementSystem/Service/FileCatalogProxyHandler.py similarity index 100% rename from DataManagementSystem/Service/FileCatalogProxyHandler.py rename to src/DIRAC/DataManagementSystem/Service/FileCatalogProxyHandler.py diff --git a/DataManagementSystem/Service/IRODSStorageElementHandler.py b/src/DIRAC/DataManagementSystem/Service/IRODSStorageElementHandler.py similarity index 100% rename from DataManagementSystem/Service/IRODSStorageElementHandler.py rename to src/DIRAC/DataManagementSystem/Service/IRODSStorageElementHandler.py diff --git a/DataManagementSystem/Service/S3GatewayHandler.py b/src/DIRAC/DataManagementSystem/Service/S3GatewayHandler.py similarity index 100% rename from DataManagementSystem/Service/S3GatewayHandler.py rename to src/DIRAC/DataManagementSystem/Service/S3GatewayHandler.py diff --git a/DataManagementSystem/Service/StorageElementHandler.py b/src/DIRAC/DataManagementSystem/Service/StorageElementHandler.py similarity index 100% rename from DataManagementSystem/Service/StorageElementHandler.py rename to src/DIRAC/DataManagementSystem/Service/StorageElementHandler.py diff --git a/DataManagementSystem/Service/StorageElementProxyHandler.py b/src/DIRAC/DataManagementSystem/Service/StorageElementProxyHandler.py similarity index 100% rename from DataManagementSystem/Service/StorageElementProxyHandler.py rename to src/DIRAC/DataManagementSystem/Service/StorageElementProxyHandler.py diff --git a/DataManagementSystem/Service/TornadoFileCatalogHandler.py b/src/DIRAC/DataManagementSystem/Service/TornadoFileCatalogHandler.py similarity index 100% rename from DataManagementSystem/Service/TornadoFileCatalogHandler.py rename to src/DIRAC/DataManagementSystem/Service/TornadoFileCatalogHandler.py diff --git a/DataManagementSystem/Service/__init__.py b/src/DIRAC/DataManagementSystem/Service/__init__.py similarity index 100% rename from DataManagementSystem/Service/__init__.py rename to src/DIRAC/DataManagementSystem/Service/__init__.py diff --git a/DataManagementSystem/Service/test/Test_Service.py b/src/DIRAC/DataManagementSystem/Service/test/Test_Service.py similarity index 100% rename from DataManagementSystem/Service/test/Test_Service.py rename to src/DIRAC/DataManagementSystem/Service/test/Test_Service.py diff --git a/DataManagementSystem/Utilities/DMSHelpers.py b/src/DIRAC/DataManagementSystem/Utilities/DMSHelpers.py similarity index 100% rename from DataManagementSystem/Utilities/DMSHelpers.py rename to src/DIRAC/DataManagementSystem/Utilities/DMSHelpers.py diff --git a/DataManagementSystem/Utilities/__init__.py b/src/DIRAC/DataManagementSystem/Utilities/__init__.py similarity index 100% rename from DataManagementSystem/Utilities/__init__.py rename to src/DIRAC/DataManagementSystem/Utilities/__init__.py diff --git a/DataManagementSystem/Utilities/lfc_dfc_copy.py b/src/DIRAC/DataManagementSystem/Utilities/lfc_dfc_copy.py similarity index 100% rename from DataManagementSystem/Utilities/lfc_dfc_copy.py rename to src/DIRAC/DataManagementSystem/Utilities/lfc_dfc_copy.py diff --git a/DataManagementSystem/__init__.py b/src/DIRAC/DataManagementSystem/__init__.py similarity index 100% rename from DataManagementSystem/__init__.py rename to src/DIRAC/DataManagementSystem/__init__.py diff --git a/DataManagementSystem/private/FTS3Utilities.py b/src/DIRAC/DataManagementSystem/private/FTS3Utilities.py similarity index 100% rename from DataManagementSystem/private/FTS3Utilities.py rename to src/DIRAC/DataManagementSystem/private/FTS3Utilities.py diff --git a/DataManagementSystem/private/HttpStorageAccessHandler.py b/src/DIRAC/DataManagementSystem/private/HttpStorageAccessHandler.py similarity index 100% rename from DataManagementSystem/private/HttpStorageAccessHandler.py rename to src/DIRAC/DataManagementSystem/private/HttpStorageAccessHandler.py diff --git a/DataManagementSystem/private/__init__.py b/src/DIRAC/DataManagementSystem/private/__init__.py similarity index 100% rename from DataManagementSystem/private/__init__.py rename to src/DIRAC/DataManagementSystem/private/__init__.py diff --git a/DataManagementSystem/private/test/Test_FTS3Utilities.py b/src/DIRAC/DataManagementSystem/private/test/Test_FTS3Utilities.py similarity index 100% rename from DataManagementSystem/private/test/Test_FTS3Utilities.py rename to src/DIRAC/DataManagementSystem/private/test/Test_FTS3Utilities.py diff --git a/DataManagementSystem/private/test/__init__.py b/src/DIRAC/DataManagementSystem/private/test/__init__.py similarity index 100% rename from DataManagementSystem/private/test/__init__.py rename to src/DIRAC/DataManagementSystem/private/test/__init__.py diff --git a/DataManagementSystem/scripts/dirac-admin-allow-se.py b/src/DIRAC/DataManagementSystem/scripts/dirac-admin-allow-se.py similarity index 100% rename from DataManagementSystem/scripts/dirac-admin-allow-se.py rename to src/DIRAC/DataManagementSystem/scripts/dirac-admin-allow-se.py diff --git a/DataManagementSystem/scripts/dirac-admin-ban-se.py b/src/DIRAC/DataManagementSystem/scripts/dirac-admin-ban-se.py similarity index 100% rename from DataManagementSystem/scripts/dirac-admin-ban-se.py rename to src/DIRAC/DataManagementSystem/scripts/dirac-admin-ban-se.py diff --git a/DataManagementSystem/scripts/dirac-admin-user-quota.py b/src/DIRAC/DataManagementSystem/scripts/dirac-admin-user-quota.py similarity index 100% rename from DataManagementSystem/scripts/dirac-admin-user-quota.py rename to src/DIRAC/DataManagementSystem/scripts/dirac-admin-user-quota.py diff --git a/DataManagementSystem/scripts/dirac-dms-add-file.py b/src/DIRAC/DataManagementSystem/scripts/dirac-dms-add-file.py similarity index 100% rename from DataManagementSystem/scripts/dirac-dms-add-file.py rename to src/DIRAC/DataManagementSystem/scripts/dirac-dms-add-file.py diff --git a/DataManagementSystem/scripts/dirac-dms-catalog-metadata.py b/src/DIRAC/DataManagementSystem/scripts/dirac-dms-catalog-metadata.py similarity index 100% rename from DataManagementSystem/scripts/dirac-dms-catalog-metadata.py rename to src/DIRAC/DataManagementSystem/scripts/dirac-dms-catalog-metadata.py diff --git a/DataManagementSystem/scripts/dirac-dms-change-replica-status.py b/src/DIRAC/DataManagementSystem/scripts/dirac-dms-change-replica-status.py similarity index 100% rename from DataManagementSystem/scripts/dirac-dms-change-replica-status.py rename to src/DIRAC/DataManagementSystem/scripts/dirac-dms-change-replica-status.py diff --git a/DataManagementSystem/scripts/dirac-dms-clean-directory.py b/src/DIRAC/DataManagementSystem/scripts/dirac-dms-clean-directory.py similarity index 100% rename from DataManagementSystem/scripts/dirac-dms-clean-directory.py rename to src/DIRAC/DataManagementSystem/scripts/dirac-dms-clean-directory.py diff --git a/DataManagementSystem/scripts/dirac-dms-create-archive-request.py b/src/DIRAC/DataManagementSystem/scripts/dirac-dms-create-archive-request.py similarity index 100% rename from DataManagementSystem/scripts/dirac-dms-create-archive-request.py rename to src/DIRAC/DataManagementSystem/scripts/dirac-dms-create-archive-request.py diff --git a/DataManagementSystem/scripts/dirac-dms-create-moving-request.py b/src/DIRAC/DataManagementSystem/scripts/dirac-dms-create-moving-request.py similarity index 100% rename from DataManagementSystem/scripts/dirac-dms-create-moving-request.py rename to src/DIRAC/DataManagementSystem/scripts/dirac-dms-create-moving-request.py diff --git a/DataManagementSystem/scripts/dirac-dms-create-removal-request.py b/src/DIRAC/DataManagementSystem/scripts/dirac-dms-create-removal-request.py similarity index 100% rename from DataManagementSystem/scripts/dirac-dms-create-removal-request.py rename to src/DIRAC/DataManagementSystem/scripts/dirac-dms-create-removal-request.py diff --git a/DataManagementSystem/scripts/dirac-dms-data-size.py b/src/DIRAC/DataManagementSystem/scripts/dirac-dms-data-size.py similarity index 100% rename from DataManagementSystem/scripts/dirac-dms-data-size.py rename to src/DIRAC/DataManagementSystem/scripts/dirac-dms-data-size.py diff --git a/DataManagementSystem/scripts/dirac-dms-directory-sync.py b/src/DIRAC/DataManagementSystem/scripts/dirac-dms-directory-sync.py similarity index 100% rename from DataManagementSystem/scripts/dirac-dms-directory-sync.py rename to src/DIRAC/DataManagementSystem/scripts/dirac-dms-directory-sync.py diff --git a/DataManagementSystem/scripts/dirac-dms-filecatalog-cli.py b/src/DIRAC/DataManagementSystem/scripts/dirac-dms-filecatalog-cli.py similarity index 100% rename from DataManagementSystem/scripts/dirac-dms-filecatalog-cli.py rename to src/DIRAC/DataManagementSystem/scripts/dirac-dms-filecatalog-cli.py diff --git a/DataManagementSystem/scripts/dirac-dms-find-lfns.py b/src/DIRAC/DataManagementSystem/scripts/dirac-dms-find-lfns.py similarity index 100% rename from DataManagementSystem/scripts/dirac-dms-find-lfns.py rename to src/DIRAC/DataManagementSystem/scripts/dirac-dms-find-lfns.py diff --git a/DataManagementSystem/scripts/dirac-dms-move-replica-request.py b/src/DIRAC/DataManagementSystem/scripts/dirac-dms-move-replica-request.py similarity index 100% rename from DataManagementSystem/scripts/dirac-dms-move-replica-request.py rename to src/DIRAC/DataManagementSystem/scripts/dirac-dms-move-replica-request.py diff --git a/DataManagementSystem/scripts/dirac-dms-protocol-matrix.py b/src/DIRAC/DataManagementSystem/scripts/dirac-dms-protocol-matrix.py similarity index 100% rename from DataManagementSystem/scripts/dirac-dms-protocol-matrix.py rename to src/DIRAC/DataManagementSystem/scripts/dirac-dms-protocol-matrix.py diff --git a/DataManagementSystem/scripts/dirac-dms-put-and-register-request.py b/src/DIRAC/DataManagementSystem/scripts/dirac-dms-put-and-register-request.py similarity index 100% rename from DataManagementSystem/scripts/dirac-dms-put-and-register-request.py rename to src/DIRAC/DataManagementSystem/scripts/dirac-dms-put-and-register-request.py diff --git a/DataManagementSystem/scripts/dirac-dms-remove-catalog-files.py b/src/DIRAC/DataManagementSystem/scripts/dirac-dms-remove-catalog-files.py similarity index 100% rename from DataManagementSystem/scripts/dirac-dms-remove-catalog-files.py rename to src/DIRAC/DataManagementSystem/scripts/dirac-dms-remove-catalog-files.py diff --git a/DataManagementSystem/scripts/dirac-dms-remove-catalog-replicas.py b/src/DIRAC/DataManagementSystem/scripts/dirac-dms-remove-catalog-replicas.py similarity index 100% rename from DataManagementSystem/scripts/dirac-dms-remove-catalog-replicas.py rename to src/DIRAC/DataManagementSystem/scripts/dirac-dms-remove-catalog-replicas.py diff --git a/DataManagementSystem/scripts/dirac-dms-remove-files.py b/src/DIRAC/DataManagementSystem/scripts/dirac-dms-remove-files.py similarity index 100% rename from DataManagementSystem/scripts/dirac-dms-remove-files.py rename to src/DIRAC/DataManagementSystem/scripts/dirac-dms-remove-files.py diff --git a/DataManagementSystem/scripts/dirac-dms-remove-replicas.py b/src/DIRAC/DataManagementSystem/scripts/dirac-dms-remove-replicas.py similarity index 100% rename from DataManagementSystem/scripts/dirac-dms-remove-replicas.py rename to src/DIRAC/DataManagementSystem/scripts/dirac-dms-remove-replicas.py diff --git a/DataManagementSystem/scripts/dirac-dms-replica-metadata.py b/src/DIRAC/DataManagementSystem/scripts/dirac-dms-replica-metadata.py similarity index 100% rename from DataManagementSystem/scripts/dirac-dms-replica-metadata.py rename to src/DIRAC/DataManagementSystem/scripts/dirac-dms-replica-metadata.py diff --git a/DataManagementSystem/scripts/dirac-dms-replicate-and-register-request.py b/src/DIRAC/DataManagementSystem/scripts/dirac-dms-replicate-and-register-request.py similarity index 100% rename from DataManagementSystem/scripts/dirac-dms-replicate-and-register-request.py rename to src/DIRAC/DataManagementSystem/scripts/dirac-dms-replicate-and-register-request.py diff --git a/DataManagementSystem/scripts/dirac-dms-resolve-guid.py b/src/DIRAC/DataManagementSystem/scripts/dirac-dms-resolve-guid.py similarity index 100% rename from DataManagementSystem/scripts/dirac-dms-resolve-guid.py rename to src/DIRAC/DataManagementSystem/scripts/dirac-dms-resolve-guid.py diff --git a/DataManagementSystem/scripts/dirac-dms-set-replica-status.py b/src/DIRAC/DataManagementSystem/scripts/dirac-dms-set-replica-status.py similarity index 100% rename from DataManagementSystem/scripts/dirac-dms-set-replica-status.py rename to src/DIRAC/DataManagementSystem/scripts/dirac-dms-set-replica-status.py diff --git a/DataManagementSystem/scripts/dirac-dms-show-se-status.py b/src/DIRAC/DataManagementSystem/scripts/dirac-dms-show-se-status.py similarity index 100% rename from DataManagementSystem/scripts/dirac-dms-show-se-status.py rename to src/DIRAC/DataManagementSystem/scripts/dirac-dms-show-se-status.py diff --git a/DataManagementSystem/scripts/dirac-dms-user-lfns.py b/src/DIRAC/DataManagementSystem/scripts/dirac-dms-user-lfns.py similarity index 100% rename from DataManagementSystem/scripts/dirac-dms-user-lfns.py rename to src/DIRAC/DataManagementSystem/scripts/dirac-dms-user-lfns.py diff --git a/DataManagementSystem/scripts/dirac-dms-user-quota.py b/src/DIRAC/DataManagementSystem/scripts/dirac-dms-user-quota.py similarity index 100% rename from DataManagementSystem/scripts/dirac-dms-user-quota.py rename to src/DIRAC/DataManagementSystem/scripts/dirac-dms-user-quota.py diff --git a/FrameworkSystem/Agent/CAUpdateAgent.py b/src/DIRAC/FrameworkSystem/Agent/CAUpdateAgent.py similarity index 100% rename from FrameworkSystem/Agent/CAUpdateAgent.py rename to src/DIRAC/FrameworkSystem/Agent/CAUpdateAgent.py diff --git a/FrameworkSystem/Agent/ErrorMessageMonitor.py b/src/DIRAC/FrameworkSystem/Agent/ErrorMessageMonitor.py similarity index 100% rename from FrameworkSystem/Agent/ErrorMessageMonitor.py rename to src/DIRAC/FrameworkSystem/Agent/ErrorMessageMonitor.py diff --git a/FrameworkSystem/Agent/MyProxyRenewalAgent.py b/src/DIRAC/FrameworkSystem/Agent/MyProxyRenewalAgent.py similarity index 100% rename from FrameworkSystem/Agent/MyProxyRenewalAgent.py rename to src/DIRAC/FrameworkSystem/Agent/MyProxyRenewalAgent.py diff --git a/FrameworkSystem/Agent/SystemLoggingDBCleaner.py b/src/DIRAC/FrameworkSystem/Agent/SystemLoggingDBCleaner.py similarity index 100% rename from FrameworkSystem/Agent/SystemLoggingDBCleaner.py rename to src/DIRAC/FrameworkSystem/Agent/SystemLoggingDBCleaner.py diff --git a/FrameworkSystem/Agent/TopErrorMessagesReporter.py b/src/DIRAC/FrameworkSystem/Agent/TopErrorMessagesReporter.py similarity index 100% rename from FrameworkSystem/Agent/TopErrorMessagesReporter.py rename to src/DIRAC/FrameworkSystem/Agent/TopErrorMessagesReporter.py diff --git a/FrameworkSystem/Agent/__init__.py b/src/DIRAC/FrameworkSystem/Agent/__init__.py similarity index 100% rename from FrameworkSystem/Agent/__init__.py rename to src/DIRAC/FrameworkSystem/Agent/__init__.py diff --git a/FrameworkSystem/Client/BundleDeliveryClient.py b/src/DIRAC/FrameworkSystem/Client/BundleDeliveryClient.py similarity index 100% rename from FrameworkSystem/Client/BundleDeliveryClient.py rename to src/DIRAC/FrameworkSystem/Client/BundleDeliveryClient.py diff --git a/FrameworkSystem/Client/ComponentInstaller.py b/src/DIRAC/FrameworkSystem/Client/ComponentInstaller.py similarity index 100% rename from FrameworkSystem/Client/ComponentInstaller.py rename to src/DIRAC/FrameworkSystem/Client/ComponentInstaller.py diff --git a/FrameworkSystem/Client/ComponentMonitoringClient.py b/src/DIRAC/FrameworkSystem/Client/ComponentMonitoringClient.py similarity index 100% rename from FrameworkSystem/Client/ComponentMonitoringClient.py rename to src/DIRAC/FrameworkSystem/Client/ComponentMonitoringClient.py diff --git a/FrameworkSystem/Client/Logger.py b/src/DIRAC/FrameworkSystem/Client/Logger.py similarity index 100% rename from FrameworkSystem/Client/Logger.py rename to src/DIRAC/FrameworkSystem/Client/Logger.py diff --git a/FrameworkSystem/Client/LoggerClient.py b/src/DIRAC/FrameworkSystem/Client/LoggerClient.py similarity index 100% rename from FrameworkSystem/Client/LoggerClient.py rename to src/DIRAC/FrameworkSystem/Client/LoggerClient.py diff --git a/FrameworkSystem/Client/MonitoringClient.py b/src/DIRAC/FrameworkSystem/Client/MonitoringClient.py similarity index 100% rename from FrameworkSystem/Client/MonitoringClient.py rename to src/DIRAC/FrameworkSystem/Client/MonitoringClient.py diff --git a/FrameworkSystem/Client/MonitoringClientIOLoop.py b/src/DIRAC/FrameworkSystem/Client/MonitoringClientIOLoop.py similarity index 100% rename from FrameworkSystem/Client/MonitoringClientIOLoop.py rename to src/DIRAC/FrameworkSystem/Client/MonitoringClientIOLoop.py diff --git a/FrameworkSystem/Client/NotificationClient.py b/src/DIRAC/FrameworkSystem/Client/NotificationClient.py similarity index 100% rename from FrameworkSystem/Client/NotificationClient.py rename to src/DIRAC/FrameworkSystem/Client/NotificationClient.py diff --git a/FrameworkSystem/Client/PlottingClient.py b/src/DIRAC/FrameworkSystem/Client/PlottingClient.py similarity index 100% rename from FrameworkSystem/Client/PlottingClient.py rename to src/DIRAC/FrameworkSystem/Client/PlottingClient.py diff --git a/FrameworkSystem/Client/ProxyGeneration.py b/src/DIRAC/FrameworkSystem/Client/ProxyGeneration.py similarity index 100% rename from FrameworkSystem/Client/ProxyGeneration.py rename to src/DIRAC/FrameworkSystem/Client/ProxyGeneration.py diff --git a/FrameworkSystem/Client/ProxyManagerClient.py b/src/DIRAC/FrameworkSystem/Client/ProxyManagerClient.py similarity index 100% rename from FrameworkSystem/Client/ProxyManagerClient.py rename to src/DIRAC/FrameworkSystem/Client/ProxyManagerClient.py diff --git a/FrameworkSystem/Client/ProxyUpload.py b/src/DIRAC/FrameworkSystem/Client/ProxyUpload.py similarity index 100% rename from FrameworkSystem/Client/ProxyUpload.py rename to src/DIRAC/FrameworkSystem/Client/ProxyUpload.py diff --git a/FrameworkSystem/Client/SecurityLogClient.py b/src/DIRAC/FrameworkSystem/Client/SecurityLogClient.py similarity index 100% rename from FrameworkSystem/Client/SecurityLogClient.py rename to src/DIRAC/FrameworkSystem/Client/SecurityLogClient.py diff --git a/FrameworkSystem/Client/SystemAdministratorClient.py b/src/DIRAC/FrameworkSystem/Client/SystemAdministratorClient.py similarity index 100% rename from FrameworkSystem/Client/SystemAdministratorClient.py rename to src/DIRAC/FrameworkSystem/Client/SystemAdministratorClient.py diff --git a/FrameworkSystem/Client/SystemAdministratorClientCLI.py b/src/DIRAC/FrameworkSystem/Client/SystemAdministratorClientCLI.py similarity index 100% rename from FrameworkSystem/Client/SystemAdministratorClientCLI.py rename to src/DIRAC/FrameworkSystem/Client/SystemAdministratorClientCLI.py diff --git a/FrameworkSystem/Client/SystemAdministratorIntegrator.py b/src/DIRAC/FrameworkSystem/Client/SystemAdministratorIntegrator.py similarity index 100% rename from FrameworkSystem/Client/SystemAdministratorIntegrator.py rename to src/DIRAC/FrameworkSystem/Client/SystemAdministratorIntegrator.py diff --git a/FrameworkSystem/Client/UserProfileClient.py b/src/DIRAC/FrameworkSystem/Client/UserProfileClient.py similarity index 100% rename from FrameworkSystem/Client/UserProfileClient.py rename to src/DIRAC/FrameworkSystem/Client/UserProfileClient.py diff --git a/FrameworkSystem/Client/__init__.py b/src/DIRAC/FrameworkSystem/Client/__init__.py similarity index 100% rename from FrameworkSystem/Client/__init__.py rename to src/DIRAC/FrameworkSystem/Client/__init__.py diff --git a/FrameworkSystem/Client/test/Test_ComponentInstaller.py b/src/DIRAC/FrameworkSystem/Client/test/Test_ComponentInstaller.py similarity index 100% rename from FrameworkSystem/Client/test/Test_ComponentInstaller.py rename to src/DIRAC/FrameworkSystem/Client/test/Test_ComponentInstaller.py diff --git a/FrameworkSystem/ConfigTemplate.cfg b/src/DIRAC/FrameworkSystem/ConfigTemplate.cfg similarity index 100% rename from FrameworkSystem/ConfigTemplate.cfg rename to src/DIRAC/FrameworkSystem/ConfigTemplate.cfg diff --git a/FrameworkSystem/DB/ComponentMonitoringDB.py b/src/DIRAC/FrameworkSystem/DB/ComponentMonitoringDB.py similarity index 100% rename from FrameworkSystem/DB/ComponentMonitoringDB.py rename to src/DIRAC/FrameworkSystem/DB/ComponentMonitoringDB.py diff --git a/FrameworkSystem/DB/ComponentMonitoringDB.sql b/src/DIRAC/FrameworkSystem/DB/ComponentMonitoringDB.sql similarity index 100% rename from FrameworkSystem/DB/ComponentMonitoringDB.sql rename to src/DIRAC/FrameworkSystem/DB/ComponentMonitoringDB.sql diff --git a/FrameworkSystem/DB/InstalledComponentsDB.py b/src/DIRAC/FrameworkSystem/DB/InstalledComponentsDB.py similarity index 100% rename from FrameworkSystem/DB/InstalledComponentsDB.py rename to src/DIRAC/FrameworkSystem/DB/InstalledComponentsDB.py diff --git a/FrameworkSystem/DB/InstalledComponentsDB.sql b/src/DIRAC/FrameworkSystem/DB/InstalledComponentsDB.sql similarity index 100% rename from FrameworkSystem/DB/InstalledComponentsDB.sql rename to src/DIRAC/FrameworkSystem/DB/InstalledComponentsDB.sql diff --git a/FrameworkSystem/DB/NotificationDB.py b/src/DIRAC/FrameworkSystem/DB/NotificationDB.py similarity index 100% rename from FrameworkSystem/DB/NotificationDB.py rename to src/DIRAC/FrameworkSystem/DB/NotificationDB.py diff --git a/FrameworkSystem/DB/NotificationDB.sql b/src/DIRAC/FrameworkSystem/DB/NotificationDB.sql similarity index 100% rename from FrameworkSystem/DB/NotificationDB.sql rename to src/DIRAC/FrameworkSystem/DB/NotificationDB.sql diff --git a/FrameworkSystem/DB/ProxyDB.py b/src/DIRAC/FrameworkSystem/DB/ProxyDB.py similarity index 100% rename from FrameworkSystem/DB/ProxyDB.py rename to src/DIRAC/FrameworkSystem/DB/ProxyDB.py diff --git a/FrameworkSystem/DB/ProxyDB.sql b/src/DIRAC/FrameworkSystem/DB/ProxyDB.sql similarity index 100% rename from FrameworkSystem/DB/ProxyDB.sql rename to src/DIRAC/FrameworkSystem/DB/ProxyDB.sql diff --git a/FrameworkSystem/DB/SystemLoggingDB.py b/src/DIRAC/FrameworkSystem/DB/SystemLoggingDB.py similarity index 100% rename from FrameworkSystem/DB/SystemLoggingDB.py rename to src/DIRAC/FrameworkSystem/DB/SystemLoggingDB.py diff --git a/FrameworkSystem/DB/SystemLoggingDB.sql b/src/DIRAC/FrameworkSystem/DB/SystemLoggingDB.sql similarity index 100% rename from FrameworkSystem/DB/SystemLoggingDB.sql rename to src/DIRAC/FrameworkSystem/DB/SystemLoggingDB.sql diff --git a/FrameworkSystem/DB/UserProfileDB.py b/src/DIRAC/FrameworkSystem/DB/UserProfileDB.py similarity index 100% rename from FrameworkSystem/DB/UserProfileDB.py rename to src/DIRAC/FrameworkSystem/DB/UserProfileDB.py diff --git a/FrameworkSystem/DB/UserProfileDB.sql b/src/DIRAC/FrameworkSystem/DB/UserProfileDB.sql similarity index 100% rename from FrameworkSystem/DB/UserProfileDB.sql rename to src/DIRAC/FrameworkSystem/DB/UserProfileDB.sql diff --git a/FrameworkSystem/DB/__init__.py b/src/DIRAC/FrameworkSystem/DB/__init__.py similarity index 100% rename from FrameworkSystem/DB/__init__.py rename to src/DIRAC/FrameworkSystem/DB/__init__.py diff --git a/FrameworkSystem/Service/BundleDeliveryHandler.py b/src/DIRAC/FrameworkSystem/Service/BundleDeliveryHandler.py similarity index 100% rename from FrameworkSystem/Service/BundleDeliveryHandler.py rename to src/DIRAC/FrameworkSystem/Service/BundleDeliveryHandler.py diff --git a/FrameworkSystem/Service/ComponentMonitoringHandler.py b/src/DIRAC/FrameworkSystem/Service/ComponentMonitoringHandler.py similarity index 100% rename from FrameworkSystem/Service/ComponentMonitoringHandler.py rename to src/DIRAC/FrameworkSystem/Service/ComponentMonitoringHandler.py diff --git a/FrameworkSystem/Service/MonitoringHandler.py b/src/DIRAC/FrameworkSystem/Service/MonitoringHandler.py similarity index 100% rename from FrameworkSystem/Service/MonitoringHandler.py rename to src/DIRAC/FrameworkSystem/Service/MonitoringHandler.py diff --git a/FrameworkSystem/Service/NotificationHandler.py b/src/DIRAC/FrameworkSystem/Service/NotificationHandler.py similarity index 100% rename from FrameworkSystem/Service/NotificationHandler.py rename to src/DIRAC/FrameworkSystem/Service/NotificationHandler.py diff --git a/FrameworkSystem/Service/PlotCache.py b/src/DIRAC/FrameworkSystem/Service/PlotCache.py similarity index 100% rename from FrameworkSystem/Service/PlotCache.py rename to src/DIRAC/FrameworkSystem/Service/PlotCache.py diff --git a/FrameworkSystem/Service/PlottingHandler.py b/src/DIRAC/FrameworkSystem/Service/PlottingHandler.py similarity index 100% rename from FrameworkSystem/Service/PlottingHandler.py rename to src/DIRAC/FrameworkSystem/Service/PlottingHandler.py diff --git a/FrameworkSystem/Service/ProxyManagerHandler.py b/src/DIRAC/FrameworkSystem/Service/ProxyManagerHandler.py similarity index 100% rename from FrameworkSystem/Service/ProxyManagerHandler.py rename to src/DIRAC/FrameworkSystem/Service/ProxyManagerHandler.py diff --git a/FrameworkSystem/Service/RabbitMQSyncHandler.py b/src/DIRAC/FrameworkSystem/Service/RabbitMQSyncHandler.py similarity index 100% rename from FrameworkSystem/Service/RabbitMQSyncHandler.py rename to src/DIRAC/FrameworkSystem/Service/RabbitMQSyncHandler.py diff --git a/FrameworkSystem/Service/SecurityLoggingHandler.py b/src/DIRAC/FrameworkSystem/Service/SecurityLoggingHandler.py similarity index 100% rename from FrameworkSystem/Service/SecurityLoggingHandler.py rename to src/DIRAC/FrameworkSystem/Service/SecurityLoggingHandler.py diff --git a/FrameworkSystem/Service/SystemAdministratorHandler.py b/src/DIRAC/FrameworkSystem/Service/SystemAdministratorHandler.py similarity index 100% rename from FrameworkSystem/Service/SystemAdministratorHandler.py rename to src/DIRAC/FrameworkSystem/Service/SystemAdministratorHandler.py diff --git a/FrameworkSystem/Service/SystemLoggingHandler.py b/src/DIRAC/FrameworkSystem/Service/SystemLoggingHandler.py similarity index 100% rename from FrameworkSystem/Service/SystemLoggingHandler.py rename to src/DIRAC/FrameworkSystem/Service/SystemLoggingHandler.py diff --git a/FrameworkSystem/Service/SystemLoggingReportHandler.py b/src/DIRAC/FrameworkSystem/Service/SystemLoggingReportHandler.py similarity index 100% rename from FrameworkSystem/Service/SystemLoggingReportHandler.py rename to src/DIRAC/FrameworkSystem/Service/SystemLoggingReportHandler.py diff --git a/FrameworkSystem/Service/UserProfileManagerHandler.py b/src/DIRAC/FrameworkSystem/Service/UserProfileManagerHandler.py similarity index 100% rename from FrameworkSystem/Service/UserProfileManagerHandler.py rename to src/DIRAC/FrameworkSystem/Service/UserProfileManagerHandler.py diff --git a/FrameworkSystem/Service/__init__.py b/src/DIRAC/FrameworkSystem/Service/__init__.py similarity index 100% rename from FrameworkSystem/Service/__init__.py rename to src/DIRAC/FrameworkSystem/Service/__init__.py diff --git a/FrameworkSystem/Utilities/MonitoringUtilities.py b/src/DIRAC/FrameworkSystem/Utilities/MonitoringUtilities.py similarity index 100% rename from FrameworkSystem/Utilities/MonitoringUtilities.py rename to src/DIRAC/FrameworkSystem/Utilities/MonitoringUtilities.py diff --git a/FrameworkSystem/Utilities/RabbitMQSynchronizer.py b/src/DIRAC/FrameworkSystem/Utilities/RabbitMQSynchronizer.py similarity index 100% rename from FrameworkSystem/Utilities/RabbitMQSynchronizer.py rename to src/DIRAC/FrameworkSystem/Utilities/RabbitMQSynchronizer.py diff --git a/FrameworkSystem/Utilities/__init__.py b/src/DIRAC/FrameworkSystem/Utilities/__init__.py similarity index 100% rename from FrameworkSystem/Utilities/__init__.py rename to src/DIRAC/FrameworkSystem/Utilities/__init__.py diff --git a/FrameworkSystem/__init__.py b/src/DIRAC/FrameworkSystem/__init__.py similarity index 100% rename from FrameworkSystem/__init__.py rename to src/DIRAC/FrameworkSystem/__init__.py diff --git a/FrameworkSystem/private/SecurityFileLog.py b/src/DIRAC/FrameworkSystem/private/SecurityFileLog.py similarity index 100% rename from FrameworkSystem/private/SecurityFileLog.py rename to src/DIRAC/FrameworkSystem/private/SecurityFileLog.py diff --git a/FrameworkSystem/private/__init__.py b/src/DIRAC/FrameworkSystem/private/__init__.py similarity index 100% rename from FrameworkSystem/private/__init__.py rename to src/DIRAC/FrameworkSystem/private/__init__.py diff --git a/FrameworkSystem/private/monitoring/Activity.py b/src/DIRAC/FrameworkSystem/private/monitoring/Activity.py similarity index 100% rename from FrameworkSystem/private/monitoring/Activity.py rename to src/DIRAC/FrameworkSystem/private/monitoring/Activity.py diff --git a/FrameworkSystem/private/monitoring/ColorGenerator.py b/src/DIRAC/FrameworkSystem/private/monitoring/ColorGenerator.py similarity index 100% rename from FrameworkSystem/private/monitoring/ColorGenerator.py rename to src/DIRAC/FrameworkSystem/private/monitoring/ColorGenerator.py diff --git a/FrameworkSystem/private/monitoring/MonitoringCatalog.py b/src/DIRAC/FrameworkSystem/private/monitoring/MonitoringCatalog.py similarity index 100% rename from FrameworkSystem/private/monitoring/MonitoringCatalog.py rename to src/DIRAC/FrameworkSystem/private/monitoring/MonitoringCatalog.py diff --git a/FrameworkSystem/private/monitoring/PlotCache.py b/src/DIRAC/FrameworkSystem/private/monitoring/PlotCache.py similarity index 100% rename from FrameworkSystem/private/monitoring/PlotCache.py rename to src/DIRAC/FrameworkSystem/private/monitoring/PlotCache.py diff --git a/FrameworkSystem/private/monitoring/RRDManager.py b/src/DIRAC/FrameworkSystem/private/monitoring/RRDManager.py similarity index 100% rename from FrameworkSystem/private/monitoring/RRDManager.py rename to src/DIRAC/FrameworkSystem/private/monitoring/RRDManager.py diff --git a/FrameworkSystem/private/monitoring/ServiceInterface.py b/src/DIRAC/FrameworkSystem/private/monitoring/ServiceInterface.py similarity index 100% rename from FrameworkSystem/private/monitoring/ServiceInterface.py rename to src/DIRAC/FrameworkSystem/private/monitoring/ServiceInterface.py diff --git a/FrameworkSystem/private/monitoring/__init__.py b/src/DIRAC/FrameworkSystem/private/monitoring/__init__.py similarity index 100% rename from FrameworkSystem/private/monitoring/__init__.py rename to src/DIRAC/FrameworkSystem/private/monitoring/__init__.py diff --git a/FrameworkSystem/private/monitoring/monitoringSchema.sql b/src/DIRAC/FrameworkSystem/private/monitoring/monitoringSchema.sql similarity index 100% rename from FrameworkSystem/private/monitoring/monitoringSchema.sql rename to src/DIRAC/FrameworkSystem/private/monitoring/monitoringSchema.sql diff --git a/FrameworkSystem/private/standardLogging/Formatter/BaseFormatter.py b/src/DIRAC/FrameworkSystem/private/standardLogging/Formatter/BaseFormatter.py similarity index 100% rename from FrameworkSystem/private/standardLogging/Formatter/BaseFormatter.py rename to src/DIRAC/FrameworkSystem/private/standardLogging/Formatter/BaseFormatter.py diff --git a/FrameworkSystem/private/standardLogging/Formatter/ColoredBaseFormatter.py b/src/DIRAC/FrameworkSystem/private/standardLogging/Formatter/ColoredBaseFormatter.py similarity index 100% rename from FrameworkSystem/private/standardLogging/Formatter/ColoredBaseFormatter.py rename to src/DIRAC/FrameworkSystem/private/standardLogging/Formatter/ColoredBaseFormatter.py diff --git a/FrameworkSystem/private/standardLogging/Formatter/__init__.py b/src/DIRAC/FrameworkSystem/private/standardLogging/Formatter/__init__.py similarity index 100% rename from FrameworkSystem/private/standardLogging/Formatter/__init__.py rename to src/DIRAC/FrameworkSystem/private/standardLogging/Formatter/__init__.py diff --git a/FrameworkSystem/private/standardLogging/Handler/MessageQueueHandler.py b/src/DIRAC/FrameworkSystem/private/standardLogging/Handler/MessageQueueHandler.py similarity index 100% rename from FrameworkSystem/private/standardLogging/Handler/MessageQueueHandler.py rename to src/DIRAC/FrameworkSystem/private/standardLogging/Handler/MessageQueueHandler.py diff --git a/FrameworkSystem/private/standardLogging/Handler/ServerHandler.py b/src/DIRAC/FrameworkSystem/private/standardLogging/Handler/ServerHandler.py similarity index 100% rename from FrameworkSystem/private/standardLogging/Handler/ServerHandler.py rename to src/DIRAC/FrameworkSystem/private/standardLogging/Handler/ServerHandler.py diff --git a/FrameworkSystem/private/standardLogging/Handler/__init__.py b/src/DIRAC/FrameworkSystem/private/standardLogging/Handler/__init__.py similarity index 100% rename from FrameworkSystem/private/standardLogging/Handler/__init__.py rename to src/DIRAC/FrameworkSystem/private/standardLogging/Handler/__init__.py diff --git a/FrameworkSystem/private/standardLogging/LogLevels.py b/src/DIRAC/FrameworkSystem/private/standardLogging/LogLevels.py similarity index 100% rename from FrameworkSystem/private/standardLogging/LogLevels.py rename to src/DIRAC/FrameworkSystem/private/standardLogging/LogLevels.py diff --git a/FrameworkSystem/private/standardLogging/Logging.py b/src/DIRAC/FrameworkSystem/private/standardLogging/Logging.py similarity index 100% rename from FrameworkSystem/private/standardLogging/Logging.py rename to src/DIRAC/FrameworkSystem/private/standardLogging/Logging.py diff --git a/FrameworkSystem/private/standardLogging/LoggingRoot.py b/src/DIRAC/FrameworkSystem/private/standardLogging/LoggingRoot.py similarity index 100% rename from FrameworkSystem/private/standardLogging/LoggingRoot.py rename to src/DIRAC/FrameworkSystem/private/standardLogging/LoggingRoot.py diff --git a/FrameworkSystem/private/standardLogging/Message.py b/src/DIRAC/FrameworkSystem/private/standardLogging/Message.py similarity index 100% rename from FrameworkSystem/private/standardLogging/Message.py rename to src/DIRAC/FrameworkSystem/private/standardLogging/Message.py diff --git a/FrameworkSystem/private/standardLogging/__init__.py b/src/DIRAC/FrameworkSystem/private/standardLogging/__init__.py similarity index 100% rename from FrameworkSystem/private/standardLogging/__init__.py rename to src/DIRAC/FrameworkSystem/private/standardLogging/__init__.py diff --git a/FrameworkSystem/private/standardLogging/test/TestLogUtilities.py b/src/DIRAC/FrameworkSystem/private/standardLogging/test/TestLogUtilities.py similarity index 100% rename from FrameworkSystem/private/standardLogging/test/TestLogUtilities.py rename to src/DIRAC/FrameworkSystem/private/standardLogging/test/TestLogUtilities.py diff --git a/FrameworkSystem/private/standardLogging/test/Test_LogLevels.py b/src/DIRAC/FrameworkSystem/private/standardLogging/test/Test_LogLevels.py similarity index 100% rename from FrameworkSystem/private/standardLogging/test/Test_LogLevels.py rename to src/DIRAC/FrameworkSystem/private/standardLogging/test/Test_LogLevels.py diff --git a/FrameworkSystem/private/standardLogging/test/Test_LoggingRoot_ConfigForExternalLibs.py b/src/DIRAC/FrameworkSystem/private/standardLogging/test/Test_LoggingRoot_ConfigForExternalLibs.py similarity index 100% rename from FrameworkSystem/private/standardLogging/test/Test_LoggingRoot_ConfigForExternalLibs.py rename to src/DIRAC/FrameworkSystem/private/standardLogging/test/Test_LoggingRoot_ConfigForExternalLibs.py diff --git a/FrameworkSystem/private/standardLogging/test/Test_Logging_Backends.py b/src/DIRAC/FrameworkSystem/private/standardLogging/test/Test_Logging_Backends.py similarity index 100% rename from FrameworkSystem/private/standardLogging/test/Test_Logging_Backends.py rename to src/DIRAC/FrameworkSystem/private/standardLogging/test/Test_Logging_Backends.py diff --git a/FrameworkSystem/private/standardLogging/test/Test_Logging_CreationLogRecord.py b/src/DIRAC/FrameworkSystem/private/standardLogging/test/Test_Logging_CreationLogRecord.py similarity index 100% rename from FrameworkSystem/private/standardLogging/test/Test_Logging_CreationLogRecord.py rename to src/DIRAC/FrameworkSystem/private/standardLogging/test/Test_Logging_CreationLogRecord.py diff --git a/FrameworkSystem/private/standardLogging/test/Test_Logging_FormatOptions.py b/src/DIRAC/FrameworkSystem/private/standardLogging/test/Test_Logging_FormatOptions.py similarity index 100% rename from FrameworkSystem/private/standardLogging/test/Test_Logging_FormatOptions.py rename to src/DIRAC/FrameworkSystem/private/standardLogging/test/Test_Logging_FormatOptions.py diff --git a/FrameworkSystem/private/standardLogging/test/Test_Logging_GetSubLogger.py b/src/DIRAC/FrameworkSystem/private/standardLogging/test/Test_Logging_GetSubLogger.py similarity index 100% rename from FrameworkSystem/private/standardLogging/test/Test_Logging_GetSubLogger.py rename to src/DIRAC/FrameworkSystem/private/standardLogging/test/Test_Logging_GetSubLogger.py diff --git a/FrameworkSystem/private/standardLogging/test/Test_Logging_Levels.py b/src/DIRAC/FrameworkSystem/private/standardLogging/test/Test_Logging_Levels.py similarity index 100% rename from FrameworkSystem/private/standardLogging/test/Test_Logging_Levels.py rename to src/DIRAC/FrameworkSystem/private/standardLogging/test/Test_Logging_Levels.py diff --git a/FrameworkSystem/private/standardLogging/test/__init__.py b/src/DIRAC/FrameworkSystem/private/standardLogging/test/__init__.py similarity index 100% rename from FrameworkSystem/private/standardLogging/test/__init__.py rename to src/DIRAC/FrameworkSystem/private/standardLogging/test/__init__.py diff --git a/FrameworkSystem/scripts/dirac-admin-get-CAs.py b/src/DIRAC/FrameworkSystem/scripts/dirac-admin-get-CAs.py similarity index 100% rename from FrameworkSystem/scripts/dirac-admin-get-CAs.py rename to src/DIRAC/FrameworkSystem/scripts/dirac-admin-get-CAs.py diff --git a/FrameworkSystem/scripts/dirac-admin-get-proxy.py b/src/DIRAC/FrameworkSystem/scripts/dirac-admin-get-proxy.py similarity index 100% rename from FrameworkSystem/scripts/dirac-admin-get-proxy.py rename to src/DIRAC/FrameworkSystem/scripts/dirac-admin-get-proxy.py diff --git a/FrameworkSystem/scripts/dirac-admin-proxy-upload.py b/src/DIRAC/FrameworkSystem/scripts/dirac-admin-proxy-upload.py similarity index 100% rename from FrameworkSystem/scripts/dirac-admin-proxy-upload.py rename to src/DIRAC/FrameworkSystem/scripts/dirac-admin-proxy-upload.py diff --git a/FrameworkSystem/scripts/dirac-admin-sysadmin-cli.py b/src/DIRAC/FrameworkSystem/scripts/dirac-admin-sysadmin-cli.py similarity index 100% rename from FrameworkSystem/scripts/dirac-admin-sysadmin-cli.py rename to src/DIRAC/FrameworkSystem/scripts/dirac-admin-sysadmin-cli.py diff --git a/FrameworkSystem/scripts/dirac-admin-update-instance.py b/src/DIRAC/FrameworkSystem/scripts/dirac-admin-update-instance.py similarity index 100% rename from FrameworkSystem/scripts/dirac-admin-update-instance.py rename to src/DIRAC/FrameworkSystem/scripts/dirac-admin-update-instance.py diff --git a/FrameworkSystem/scripts/dirac-admin-update-pilot.py b/src/DIRAC/FrameworkSystem/scripts/dirac-admin-update-pilot.py similarity index 100% rename from FrameworkSystem/scripts/dirac-admin-update-pilot.py rename to src/DIRAC/FrameworkSystem/scripts/dirac-admin-update-pilot.py diff --git a/FrameworkSystem/scripts/dirac-admin-users-with-proxy.py b/src/DIRAC/FrameworkSystem/scripts/dirac-admin-users-with-proxy.py similarity index 100% rename from FrameworkSystem/scripts/dirac-admin-users-with-proxy.py rename to src/DIRAC/FrameworkSystem/scripts/dirac-admin-users-with-proxy.py diff --git a/FrameworkSystem/scripts/dirac-install-component.py b/src/DIRAC/FrameworkSystem/scripts/dirac-install-component.py similarity index 100% rename from FrameworkSystem/scripts/dirac-install-component.py rename to src/DIRAC/FrameworkSystem/scripts/dirac-install-component.py diff --git a/FrameworkSystem/scripts/dirac-install-tornado-service.py b/src/DIRAC/FrameworkSystem/scripts/dirac-install-tornado-service.py similarity index 100% rename from FrameworkSystem/scripts/dirac-install-tornado-service.py rename to src/DIRAC/FrameworkSystem/scripts/dirac-install-tornado-service.py diff --git a/FrameworkSystem/scripts/dirac-monitoring-get-components-status.py b/src/DIRAC/FrameworkSystem/scripts/dirac-monitoring-get-components-status.py similarity index 100% rename from FrameworkSystem/scripts/dirac-monitoring-get-components-status.py rename to src/DIRAC/FrameworkSystem/scripts/dirac-monitoring-get-components-status.py diff --git a/FrameworkSystem/scripts/dirac-myproxy-upload.py b/src/DIRAC/FrameworkSystem/scripts/dirac-myproxy-upload.py similarity index 100% rename from FrameworkSystem/scripts/dirac-myproxy-upload.py rename to src/DIRAC/FrameworkSystem/scripts/dirac-myproxy-upload.py diff --git a/FrameworkSystem/scripts/dirac-populate-component-db.py b/src/DIRAC/FrameworkSystem/scripts/dirac-populate-component-db.py similarity index 100% rename from FrameworkSystem/scripts/dirac-populate-component-db.py rename to src/DIRAC/FrameworkSystem/scripts/dirac-populate-component-db.py diff --git a/FrameworkSystem/scripts/dirac-proxy-destroy.py b/src/DIRAC/FrameworkSystem/scripts/dirac-proxy-destroy.py similarity index 100% rename from FrameworkSystem/scripts/dirac-proxy-destroy.py rename to src/DIRAC/FrameworkSystem/scripts/dirac-proxy-destroy.py diff --git a/FrameworkSystem/scripts/dirac-proxy-get-uploaded-info.py b/src/DIRAC/FrameworkSystem/scripts/dirac-proxy-get-uploaded-info.py similarity index 100% rename from FrameworkSystem/scripts/dirac-proxy-get-uploaded-info.py rename to src/DIRAC/FrameworkSystem/scripts/dirac-proxy-get-uploaded-info.py diff --git a/FrameworkSystem/scripts/dirac-proxy-info.py b/src/DIRAC/FrameworkSystem/scripts/dirac-proxy-info.py similarity index 100% rename from FrameworkSystem/scripts/dirac-proxy-info.py rename to src/DIRAC/FrameworkSystem/scripts/dirac-proxy-info.py diff --git a/FrameworkSystem/scripts/dirac-proxy-init.py b/src/DIRAC/FrameworkSystem/scripts/dirac-proxy-init.py similarity index 100% rename from FrameworkSystem/scripts/dirac-proxy-init.py rename to src/DIRAC/FrameworkSystem/scripts/dirac-proxy-init.py diff --git a/FrameworkSystem/scripts/dirac-restart-component.py b/src/DIRAC/FrameworkSystem/scripts/dirac-restart-component.py similarity index 100% rename from FrameworkSystem/scripts/dirac-restart-component.py rename to src/DIRAC/FrameworkSystem/scripts/dirac-restart-component.py diff --git a/FrameworkSystem/scripts/dirac-start-component.py b/src/DIRAC/FrameworkSystem/scripts/dirac-start-component.py similarity index 100% rename from FrameworkSystem/scripts/dirac-start-component.py rename to src/DIRAC/FrameworkSystem/scripts/dirac-start-component.py diff --git a/FrameworkSystem/scripts/dirac-status-component.py b/src/DIRAC/FrameworkSystem/scripts/dirac-status-component.py similarity index 100% rename from FrameworkSystem/scripts/dirac-status-component.py rename to src/DIRAC/FrameworkSystem/scripts/dirac-status-component.py diff --git a/FrameworkSystem/scripts/dirac-stop-component.py b/src/DIRAC/FrameworkSystem/scripts/dirac-stop-component.py similarity index 100% rename from FrameworkSystem/scripts/dirac-stop-component.py rename to src/DIRAC/FrameworkSystem/scripts/dirac-stop-component.py diff --git a/FrameworkSystem/scripts/dirac-sys-sendmail.py b/src/DIRAC/FrameworkSystem/scripts/dirac-sys-sendmail.py similarity index 100% rename from FrameworkSystem/scripts/dirac-sys-sendmail.py rename to src/DIRAC/FrameworkSystem/scripts/dirac-sys-sendmail.py diff --git a/FrameworkSystem/scripts/dirac-uninstall-component.py b/src/DIRAC/FrameworkSystem/scripts/dirac-uninstall-component.py similarity index 100% rename from FrameworkSystem/scripts/dirac-uninstall-component.py rename to src/DIRAC/FrameworkSystem/scripts/dirac-uninstall-component.py diff --git a/Interfaces/API/Dirac.py b/src/DIRAC/Interfaces/API/Dirac.py similarity index 100% rename from Interfaces/API/Dirac.py rename to src/DIRAC/Interfaces/API/Dirac.py diff --git a/Interfaces/API/DiracAdmin.py b/src/DIRAC/Interfaces/API/DiracAdmin.py similarity index 100% rename from Interfaces/API/DiracAdmin.py rename to src/DIRAC/Interfaces/API/DiracAdmin.py diff --git a/Interfaces/API/Job.py b/src/DIRAC/Interfaces/API/Job.py similarity index 100% rename from Interfaces/API/Job.py rename to src/DIRAC/Interfaces/API/Job.py diff --git a/Interfaces/API/JobRepository.py b/src/DIRAC/Interfaces/API/JobRepository.py similarity index 100% rename from Interfaces/API/JobRepository.py rename to src/DIRAC/Interfaces/API/JobRepository.py diff --git a/Interfaces/API/__init__.py b/src/DIRAC/Interfaces/API/__init__.py similarity index 100% rename from Interfaces/API/__init__.py rename to src/DIRAC/Interfaces/API/__init__.py diff --git a/Interfaces/API/test/Test_DIRAC.py b/src/DIRAC/Interfaces/API/test/Test_DIRAC.py similarity index 100% rename from Interfaces/API/test/Test_DIRAC.py rename to src/DIRAC/Interfaces/API/test/Test_DIRAC.py diff --git a/Interfaces/API/test/Test_JobAPI.py b/src/DIRAC/Interfaces/API/test/Test_JobAPI.py similarity index 81% rename from Interfaces/API/test/Test_JobAPI.py rename to src/DIRAC/Interfaces/API/test/Test_JobAPI.py index 8107d4c0bc8..f7deacbe4ac 100644 --- a/Interfaces/API/test/Test_JobAPI.py +++ b/src/DIRAC/Interfaces/API/test/Test_JobAPI.py @@ -6,6 +6,8 @@ __RCSID__ = "$Id$" +from os.path import dirname, join + import pytest from six import StringIO @@ -26,21 +28,13 @@ def test_basicJob(): xml = job._toXML() - try: - with open('./DIRAC/Interfaces/API/test/testWF.xml') as fd: - expected = fd.read() - except IOError: - with open('./Interfaces/API/test/testWF.xml') as fd: - expected = fd.read() + with open(join(dirname(__file__), "testWF.xml")) as fd: + expected = fd.read() assert xml == expected - try: - with open('./DIRAC/Interfaces/API/test/testWFSIO.jdl') as fd: - expected = fd.read() - except IOError: - with open('./Interfaces/API/test/testWFSIO.jdl') as fd: - expected = fd.read() + with open(join(dirname(__file__), "testWFSIO.jdl")) as fd: + expected = fd.read() jdlSIO = job._toJDL(jobDescriptionObject=StringIO(job._toXML())) assert jdlSIO == expected @@ -71,12 +65,8 @@ def test_SimpleParametricJob(): jdl = job._toJDL() - try: - with open('./DIRAC/Interfaces/API/test/testWF.jdl') as fd: - expected = fd.read() - except IOError: - with open('./Interfaces/API/test/testWF.jdl') as fd: - expected = fd.read() + with open(join(dirname(__file__), "testWF.jdl")) as fd: + expected = fd.read() assert jdl == expected diff --git a/Interfaces/API/test/testWF.jdl b/src/DIRAC/Interfaces/API/test/testWF.jdl similarity index 100% rename from Interfaces/API/test/testWF.jdl rename to src/DIRAC/Interfaces/API/test/testWF.jdl diff --git a/Interfaces/API/test/testWF.xml b/src/DIRAC/Interfaces/API/test/testWF.xml similarity index 100% rename from Interfaces/API/test/testWF.xml rename to src/DIRAC/Interfaces/API/test/testWF.xml diff --git a/Interfaces/API/test/testWFSIO.jdl b/src/DIRAC/Interfaces/API/test/testWFSIO.jdl similarity index 100% rename from Interfaces/API/test/testWFSIO.jdl rename to src/DIRAC/Interfaces/API/test/testWFSIO.jdl diff --git a/Interfaces/__init__.py b/src/DIRAC/Interfaces/__init__.py similarity index 100% rename from Interfaces/__init__.py rename to src/DIRAC/Interfaces/__init__.py diff --git a/Interfaces/scripts/__init__.py b/src/DIRAC/Interfaces/scripts/__init__.py similarity index 100% rename from Interfaces/scripts/__init__.py rename to src/DIRAC/Interfaces/scripts/__init__.py diff --git a/Interfaces/scripts/dirac-admin-add-group.py b/src/DIRAC/Interfaces/scripts/dirac-admin-add-group.py similarity index 100% rename from Interfaces/scripts/dirac-admin-add-group.py rename to src/DIRAC/Interfaces/scripts/dirac-admin-add-group.py diff --git a/Interfaces/scripts/dirac-admin-add-host.py b/src/DIRAC/Interfaces/scripts/dirac-admin-add-host.py similarity index 100% rename from Interfaces/scripts/dirac-admin-add-host.py rename to src/DIRAC/Interfaces/scripts/dirac-admin-add-host.py diff --git a/Interfaces/scripts/dirac-admin-add-user.py b/src/DIRAC/Interfaces/scripts/dirac-admin-add-user.py similarity index 100% rename from Interfaces/scripts/dirac-admin-add-user.py rename to src/DIRAC/Interfaces/scripts/dirac-admin-add-user.py diff --git a/Interfaces/scripts/dirac-admin-allow-site.py b/src/DIRAC/Interfaces/scripts/dirac-admin-allow-site.py similarity index 100% rename from Interfaces/scripts/dirac-admin-allow-site.py rename to src/DIRAC/Interfaces/scripts/dirac-admin-allow-site.py diff --git a/Interfaces/scripts/dirac-admin-ban-site.py b/src/DIRAC/Interfaces/scripts/dirac-admin-ban-site.py similarity index 100% rename from Interfaces/scripts/dirac-admin-ban-site.py rename to src/DIRAC/Interfaces/scripts/dirac-admin-ban-site.py diff --git a/Interfaces/scripts/dirac-admin-ce-info.py b/src/DIRAC/Interfaces/scripts/dirac-admin-ce-info.py similarity index 100% rename from Interfaces/scripts/dirac-admin-ce-info.py rename to src/DIRAC/Interfaces/scripts/dirac-admin-ce-info.py diff --git a/Interfaces/scripts/dirac-admin-delete-user.py b/src/DIRAC/Interfaces/scripts/dirac-admin-delete-user.py similarity index 100% rename from Interfaces/scripts/dirac-admin-delete-user.py rename to src/DIRAC/Interfaces/scripts/dirac-admin-delete-user.py diff --git a/Interfaces/scripts/dirac-admin-get-banned-sites.py b/src/DIRAC/Interfaces/scripts/dirac-admin-get-banned-sites.py similarity index 100% rename from Interfaces/scripts/dirac-admin-get-banned-sites.py rename to src/DIRAC/Interfaces/scripts/dirac-admin-get-banned-sites.py diff --git a/Interfaces/scripts/dirac-admin-get-job-pilot-output.py b/src/DIRAC/Interfaces/scripts/dirac-admin-get-job-pilot-output.py similarity index 100% rename from Interfaces/scripts/dirac-admin-get-job-pilot-output.py rename to src/DIRAC/Interfaces/scripts/dirac-admin-get-job-pilot-output.py diff --git a/Interfaces/scripts/dirac-admin-get-job-pilots.py b/src/DIRAC/Interfaces/scripts/dirac-admin-get-job-pilots.py similarity index 100% rename from Interfaces/scripts/dirac-admin-get-job-pilots.py rename to src/DIRAC/Interfaces/scripts/dirac-admin-get-job-pilots.py diff --git a/Interfaces/scripts/dirac-admin-get-pilot-info.py b/src/DIRAC/Interfaces/scripts/dirac-admin-get-pilot-info.py similarity index 100% rename from Interfaces/scripts/dirac-admin-get-pilot-info.py rename to src/DIRAC/Interfaces/scripts/dirac-admin-get-pilot-info.py diff --git a/Interfaces/scripts/dirac-admin-get-pilot-logging-info.py b/src/DIRAC/Interfaces/scripts/dirac-admin-get-pilot-logging-info.py similarity index 100% rename from Interfaces/scripts/dirac-admin-get-pilot-logging-info.py rename to src/DIRAC/Interfaces/scripts/dirac-admin-get-pilot-logging-info.py diff --git a/Interfaces/scripts/dirac-admin-get-pilot-output.py b/src/DIRAC/Interfaces/scripts/dirac-admin-get-pilot-output.py similarity index 100% rename from Interfaces/scripts/dirac-admin-get-pilot-output.py rename to src/DIRAC/Interfaces/scripts/dirac-admin-get-pilot-output.py diff --git a/Interfaces/scripts/dirac-admin-get-site-mask.py b/src/DIRAC/Interfaces/scripts/dirac-admin-get-site-mask.py similarity index 100% rename from Interfaces/scripts/dirac-admin-get-site-mask.py rename to src/DIRAC/Interfaces/scripts/dirac-admin-get-site-mask.py diff --git a/Interfaces/scripts/dirac-admin-list-hosts.py b/src/DIRAC/Interfaces/scripts/dirac-admin-list-hosts.py similarity index 100% rename from Interfaces/scripts/dirac-admin-list-hosts.py rename to src/DIRAC/Interfaces/scripts/dirac-admin-list-hosts.py diff --git a/Interfaces/scripts/dirac-admin-list-users.py b/src/DIRAC/Interfaces/scripts/dirac-admin-list-users.py similarity index 100% rename from Interfaces/scripts/dirac-admin-list-users.py rename to src/DIRAC/Interfaces/scripts/dirac-admin-list-users.py diff --git a/Interfaces/scripts/dirac-admin-modify-user.py b/src/DIRAC/Interfaces/scripts/dirac-admin-modify-user.py similarity index 100% rename from Interfaces/scripts/dirac-admin-modify-user.py rename to src/DIRAC/Interfaces/scripts/dirac-admin-modify-user.py diff --git a/Interfaces/scripts/dirac-admin-pilot-summary.py b/src/DIRAC/Interfaces/scripts/dirac-admin-pilot-summary.py similarity index 100% rename from Interfaces/scripts/dirac-admin-pilot-summary.py rename to src/DIRAC/Interfaces/scripts/dirac-admin-pilot-summary.py diff --git a/Interfaces/scripts/dirac-admin-reset-job.py b/src/DIRAC/Interfaces/scripts/dirac-admin-reset-job.py similarity index 100% rename from Interfaces/scripts/dirac-admin-reset-job.py rename to src/DIRAC/Interfaces/scripts/dirac-admin-reset-job.py diff --git a/Interfaces/scripts/dirac-admin-service-ports.py b/src/DIRAC/Interfaces/scripts/dirac-admin-service-ports.py similarity index 100% rename from Interfaces/scripts/dirac-admin-service-ports.py rename to src/DIRAC/Interfaces/scripts/dirac-admin-service-ports.py diff --git a/Interfaces/scripts/dirac-admin-set-site-protocols.py b/src/DIRAC/Interfaces/scripts/dirac-admin-set-site-protocols.py similarity index 100% rename from Interfaces/scripts/dirac-admin-set-site-protocols.py rename to src/DIRAC/Interfaces/scripts/dirac-admin-set-site-protocols.py diff --git a/Interfaces/scripts/dirac-admin-site-info.py b/src/DIRAC/Interfaces/scripts/dirac-admin-site-info.py similarity index 100% rename from Interfaces/scripts/dirac-admin-site-info.py rename to src/DIRAC/Interfaces/scripts/dirac-admin-site-info.py diff --git a/Interfaces/scripts/dirac-admin-site-mask-logging.py b/src/DIRAC/Interfaces/scripts/dirac-admin-site-mask-logging.py similarity index 100% rename from Interfaces/scripts/dirac-admin-site-mask-logging.py rename to src/DIRAC/Interfaces/scripts/dirac-admin-site-mask-logging.py diff --git a/Interfaces/scripts/dirac-admin-sync-users-from-file.py b/src/DIRAC/Interfaces/scripts/dirac-admin-sync-users-from-file.py similarity index 100% rename from Interfaces/scripts/dirac-admin-sync-users-from-file.py rename to src/DIRAC/Interfaces/scripts/dirac-admin-sync-users-from-file.py diff --git a/Interfaces/scripts/dirac-dms-get-file.py b/src/DIRAC/Interfaces/scripts/dirac-dms-get-file.py similarity index 100% rename from Interfaces/scripts/dirac-dms-get-file.py rename to src/DIRAC/Interfaces/scripts/dirac-dms-get-file.py diff --git a/Interfaces/scripts/dirac-dms-lfn-accessURL.py b/src/DIRAC/Interfaces/scripts/dirac-dms-lfn-accessURL.py similarity index 100% rename from Interfaces/scripts/dirac-dms-lfn-accessURL.py rename to src/DIRAC/Interfaces/scripts/dirac-dms-lfn-accessURL.py diff --git a/Interfaces/scripts/dirac-dms-lfn-metadata.py b/src/DIRAC/Interfaces/scripts/dirac-dms-lfn-metadata.py similarity index 100% rename from Interfaces/scripts/dirac-dms-lfn-metadata.py rename to src/DIRAC/Interfaces/scripts/dirac-dms-lfn-metadata.py diff --git a/Interfaces/scripts/dirac-dms-lfn-replicas.py b/src/DIRAC/Interfaces/scripts/dirac-dms-lfn-replicas.py similarity index 100% rename from Interfaces/scripts/dirac-dms-lfn-replicas.py rename to src/DIRAC/Interfaces/scripts/dirac-dms-lfn-replicas.py diff --git a/Interfaces/scripts/dirac-dms-pfn-accessURL.py b/src/DIRAC/Interfaces/scripts/dirac-dms-pfn-accessURL.py similarity index 100% rename from Interfaces/scripts/dirac-dms-pfn-accessURL.py rename to src/DIRAC/Interfaces/scripts/dirac-dms-pfn-accessURL.py diff --git a/Interfaces/scripts/dirac-dms-pfn-metadata.py b/src/DIRAC/Interfaces/scripts/dirac-dms-pfn-metadata.py similarity index 100% rename from Interfaces/scripts/dirac-dms-pfn-metadata.py rename to src/DIRAC/Interfaces/scripts/dirac-dms-pfn-metadata.py diff --git a/Interfaces/scripts/dirac-dms-replicate-lfn.py b/src/DIRAC/Interfaces/scripts/dirac-dms-replicate-lfn.py similarity index 100% rename from Interfaces/scripts/dirac-dms-replicate-lfn.py rename to src/DIRAC/Interfaces/scripts/dirac-dms-replicate-lfn.py diff --git a/Interfaces/scripts/dirac-framework-ping-service.py b/src/DIRAC/Interfaces/scripts/dirac-framework-ping-service.py similarity index 100% rename from Interfaces/scripts/dirac-framework-ping-service.py rename to src/DIRAC/Interfaces/scripts/dirac-framework-ping-service.py diff --git a/Interfaces/scripts/dirac-framework-self-ping.py b/src/DIRAC/Interfaces/scripts/dirac-framework-self-ping.py similarity index 100% rename from Interfaces/scripts/dirac-framework-self-ping.py rename to src/DIRAC/Interfaces/scripts/dirac-framework-self-ping.py diff --git a/Interfaces/scripts/dirac-repo-monitor.py b/src/DIRAC/Interfaces/scripts/dirac-repo-monitor.py similarity index 100% rename from Interfaces/scripts/dirac-repo-monitor.py rename to src/DIRAC/Interfaces/scripts/dirac-repo-monitor.py diff --git a/Interfaces/scripts/dirac-utils-file-adler.py b/src/DIRAC/Interfaces/scripts/dirac-utils-file-adler.py similarity index 100% rename from Interfaces/scripts/dirac-utils-file-adler.py rename to src/DIRAC/Interfaces/scripts/dirac-utils-file-adler.py diff --git a/Interfaces/scripts/dirac-utils-file-md5.py b/src/DIRAC/Interfaces/scripts/dirac-utils-file-md5.py similarity index 100% rename from Interfaces/scripts/dirac-utils-file-md5.py rename to src/DIRAC/Interfaces/scripts/dirac-utils-file-md5.py diff --git a/Interfaces/scripts/dirac-wms-get-normalized-queue-length.py b/src/DIRAC/Interfaces/scripts/dirac-wms-get-normalized-queue-length.py similarity index 100% rename from Interfaces/scripts/dirac-wms-get-normalized-queue-length.py rename to src/DIRAC/Interfaces/scripts/dirac-wms-get-normalized-queue-length.py diff --git a/Interfaces/scripts/dirac-wms-get-queue-normalization.py b/src/DIRAC/Interfaces/scripts/dirac-wms-get-queue-normalization.py similarity index 100% rename from Interfaces/scripts/dirac-wms-get-queue-normalization.py rename to src/DIRAC/Interfaces/scripts/dirac-wms-get-queue-normalization.py diff --git a/Interfaces/scripts/dirac-wms-job-attributes.py b/src/DIRAC/Interfaces/scripts/dirac-wms-job-attributes.py similarity index 100% rename from Interfaces/scripts/dirac-wms-job-attributes.py rename to src/DIRAC/Interfaces/scripts/dirac-wms-job-attributes.py diff --git a/Interfaces/scripts/dirac-wms-job-delete.py b/src/DIRAC/Interfaces/scripts/dirac-wms-job-delete.py similarity index 100% rename from Interfaces/scripts/dirac-wms-job-delete.py rename to src/DIRAC/Interfaces/scripts/dirac-wms-job-delete.py diff --git a/Interfaces/scripts/dirac-wms-job-get-input.py b/src/DIRAC/Interfaces/scripts/dirac-wms-job-get-input.py similarity index 100% rename from Interfaces/scripts/dirac-wms-job-get-input.py rename to src/DIRAC/Interfaces/scripts/dirac-wms-job-get-input.py diff --git a/Interfaces/scripts/dirac-wms-job-get-jdl.py b/src/DIRAC/Interfaces/scripts/dirac-wms-job-get-jdl.py similarity index 100% rename from Interfaces/scripts/dirac-wms-job-get-jdl.py rename to src/DIRAC/Interfaces/scripts/dirac-wms-job-get-jdl.py diff --git a/Interfaces/scripts/dirac-wms-job-get-output-data.py b/src/DIRAC/Interfaces/scripts/dirac-wms-job-get-output-data.py similarity index 100% rename from Interfaces/scripts/dirac-wms-job-get-output-data.py rename to src/DIRAC/Interfaces/scripts/dirac-wms-job-get-output-data.py diff --git a/Interfaces/scripts/dirac-wms-job-get-output.py b/src/DIRAC/Interfaces/scripts/dirac-wms-job-get-output.py similarity index 100% rename from Interfaces/scripts/dirac-wms-job-get-output.py rename to src/DIRAC/Interfaces/scripts/dirac-wms-job-get-output.py diff --git a/Interfaces/scripts/dirac-wms-job-kill.py b/src/DIRAC/Interfaces/scripts/dirac-wms-job-kill.py similarity index 100% rename from Interfaces/scripts/dirac-wms-job-kill.py rename to src/DIRAC/Interfaces/scripts/dirac-wms-job-kill.py diff --git a/Interfaces/scripts/dirac-wms-job-logging-info.py b/src/DIRAC/Interfaces/scripts/dirac-wms-job-logging-info.py similarity index 100% rename from Interfaces/scripts/dirac-wms-job-logging-info.py rename to src/DIRAC/Interfaces/scripts/dirac-wms-job-logging-info.py diff --git a/Interfaces/scripts/dirac-wms-job-parameters.py b/src/DIRAC/Interfaces/scripts/dirac-wms-job-parameters.py similarity index 100% rename from Interfaces/scripts/dirac-wms-job-parameters.py rename to src/DIRAC/Interfaces/scripts/dirac-wms-job-parameters.py diff --git a/Interfaces/scripts/dirac-wms-job-peek.py b/src/DIRAC/Interfaces/scripts/dirac-wms-job-peek.py similarity index 100% rename from Interfaces/scripts/dirac-wms-job-peek.py rename to src/DIRAC/Interfaces/scripts/dirac-wms-job-peek.py diff --git a/Interfaces/scripts/dirac-wms-job-reschedule.py b/src/DIRAC/Interfaces/scripts/dirac-wms-job-reschedule.py similarity index 100% rename from Interfaces/scripts/dirac-wms-job-reschedule.py rename to src/DIRAC/Interfaces/scripts/dirac-wms-job-reschedule.py diff --git a/Interfaces/scripts/dirac-wms-job-status.py b/src/DIRAC/Interfaces/scripts/dirac-wms-job-status.py similarity index 100% rename from Interfaces/scripts/dirac-wms-job-status.py rename to src/DIRAC/Interfaces/scripts/dirac-wms-job-status.py diff --git a/Interfaces/scripts/dirac-wms-job-submit.py b/src/DIRAC/Interfaces/scripts/dirac-wms-job-submit.py similarity index 100% rename from Interfaces/scripts/dirac-wms-job-submit.py rename to src/DIRAC/Interfaces/scripts/dirac-wms-job-submit.py diff --git a/Interfaces/scripts/dirac-wms-jobs-select-output-search.py b/src/DIRAC/Interfaces/scripts/dirac-wms-jobs-select-output-search.py similarity index 100% rename from Interfaces/scripts/dirac-wms-jobs-select-output-search.py rename to src/DIRAC/Interfaces/scripts/dirac-wms-jobs-select-output-search.py diff --git a/Interfaces/scripts/dirac-wms-select-jobs.py b/src/DIRAC/Interfaces/scripts/dirac-wms-select-jobs.py similarity index 100% rename from Interfaces/scripts/dirac-wms-select-jobs.py rename to src/DIRAC/Interfaces/scripts/dirac-wms-select-jobs.py diff --git a/MonitoringSystem/Client/MonitoringClient.py b/src/DIRAC/MonitoringSystem/Client/MonitoringClient.py similarity index 100% rename from MonitoringSystem/Client/MonitoringClient.py rename to src/DIRAC/MonitoringSystem/Client/MonitoringClient.py diff --git a/MonitoringSystem/Client/MonitoringReporter.py b/src/DIRAC/MonitoringSystem/Client/MonitoringReporter.py similarity index 100% rename from MonitoringSystem/Client/MonitoringReporter.py rename to src/DIRAC/MonitoringSystem/Client/MonitoringReporter.py diff --git a/MonitoringSystem/Client/ServerUtils.py b/src/DIRAC/MonitoringSystem/Client/ServerUtils.py similarity index 100% rename from MonitoringSystem/Client/ServerUtils.py rename to src/DIRAC/MonitoringSystem/Client/ServerUtils.py diff --git a/MonitoringSystem/Client/Types/BaseType.py b/src/DIRAC/MonitoringSystem/Client/Types/BaseType.py similarity index 100% rename from MonitoringSystem/Client/Types/BaseType.py rename to src/DIRAC/MonitoringSystem/Client/Types/BaseType.py diff --git a/MonitoringSystem/Client/Types/ComponentMonitoring.py b/src/DIRAC/MonitoringSystem/Client/Types/ComponentMonitoring.py similarity index 100% rename from MonitoringSystem/Client/Types/ComponentMonitoring.py rename to src/DIRAC/MonitoringSystem/Client/Types/ComponentMonitoring.py diff --git a/MonitoringSystem/Client/Types/RMSMonitoring.py b/src/DIRAC/MonitoringSystem/Client/Types/RMSMonitoring.py similarity index 100% rename from MonitoringSystem/Client/Types/RMSMonitoring.py rename to src/DIRAC/MonitoringSystem/Client/Types/RMSMonitoring.py diff --git a/MonitoringSystem/Client/Types/WMSHistory.py b/src/DIRAC/MonitoringSystem/Client/Types/WMSHistory.py similarity index 100% rename from MonitoringSystem/Client/Types/WMSHistory.py rename to src/DIRAC/MonitoringSystem/Client/Types/WMSHistory.py diff --git a/MonitoringSystem/Client/Types/__init__.py b/src/DIRAC/MonitoringSystem/Client/Types/__init__.py similarity index 100% rename from MonitoringSystem/Client/Types/__init__.py rename to src/DIRAC/MonitoringSystem/Client/Types/__init__.py diff --git a/MonitoringSystem/Client/__init__.py b/src/DIRAC/MonitoringSystem/Client/__init__.py similarity index 100% rename from MonitoringSystem/Client/__init__.py rename to src/DIRAC/MonitoringSystem/Client/__init__.py diff --git a/MonitoringSystem/ConfigTemplate.cfg b/src/DIRAC/MonitoringSystem/ConfigTemplate.cfg similarity index 100% rename from MonitoringSystem/ConfigTemplate.cfg rename to src/DIRAC/MonitoringSystem/ConfigTemplate.cfg diff --git a/MonitoringSystem/DB/MonitoringDB.py b/src/DIRAC/MonitoringSystem/DB/MonitoringDB.py similarity index 100% rename from MonitoringSystem/DB/MonitoringDB.py rename to src/DIRAC/MonitoringSystem/DB/MonitoringDB.py diff --git a/MonitoringSystem/DB/__init__.py b/src/DIRAC/MonitoringSystem/DB/__init__.py similarity index 100% rename from MonitoringSystem/DB/__init__.py rename to src/DIRAC/MonitoringSystem/DB/__init__.py diff --git a/MonitoringSystem/DB/test/Test_monitoringdb.py b/src/DIRAC/MonitoringSystem/DB/test/Test_monitoringdb.py similarity index 100% rename from MonitoringSystem/DB/test/Test_monitoringdb.py rename to src/DIRAC/MonitoringSystem/DB/test/Test_monitoringdb.py diff --git a/MonitoringSystem/Service/MonitoringHandler.py b/src/DIRAC/MonitoringSystem/Service/MonitoringHandler.py similarity index 100% rename from MonitoringSystem/Service/MonitoringHandler.py rename to src/DIRAC/MonitoringSystem/Service/MonitoringHandler.py diff --git a/MonitoringSystem/Service/__init__.py b/src/DIRAC/MonitoringSystem/Service/__init__.py similarity index 100% rename from MonitoringSystem/Service/__init__.py rename to src/DIRAC/MonitoringSystem/Service/__init__.py diff --git a/MonitoringSystem/__init__.py b/src/DIRAC/MonitoringSystem/__init__.py similarity index 100% rename from MonitoringSystem/__init__.py rename to src/DIRAC/MonitoringSystem/__init__.py diff --git a/MonitoringSystem/private/DBUtils.py b/src/DIRAC/MonitoringSystem/private/DBUtils.py similarity index 100% rename from MonitoringSystem/private/DBUtils.py rename to src/DIRAC/MonitoringSystem/private/DBUtils.py diff --git a/MonitoringSystem/private/MainReporter.py b/src/DIRAC/MonitoringSystem/private/MainReporter.py similarity index 100% rename from MonitoringSystem/private/MainReporter.py rename to src/DIRAC/MonitoringSystem/private/MainReporter.py diff --git a/MonitoringSystem/private/Plotters/BasePlotter.py b/src/DIRAC/MonitoringSystem/private/Plotters/BasePlotter.py similarity index 100% rename from MonitoringSystem/private/Plotters/BasePlotter.py rename to src/DIRAC/MonitoringSystem/private/Plotters/BasePlotter.py diff --git a/MonitoringSystem/private/Plotters/ComponentMonitoringPlotter.py b/src/DIRAC/MonitoringSystem/private/Plotters/ComponentMonitoringPlotter.py similarity index 100% rename from MonitoringSystem/private/Plotters/ComponentMonitoringPlotter.py rename to src/DIRAC/MonitoringSystem/private/Plotters/ComponentMonitoringPlotter.py diff --git a/MonitoringSystem/private/Plotters/RMSMonitoringPlotter.py b/src/DIRAC/MonitoringSystem/private/Plotters/RMSMonitoringPlotter.py similarity index 100% rename from MonitoringSystem/private/Plotters/RMSMonitoringPlotter.py rename to src/DIRAC/MonitoringSystem/private/Plotters/RMSMonitoringPlotter.py diff --git a/MonitoringSystem/private/Plotters/WMSHistoryPlotter.py b/src/DIRAC/MonitoringSystem/private/Plotters/WMSHistoryPlotter.py similarity index 100% rename from MonitoringSystem/private/Plotters/WMSHistoryPlotter.py rename to src/DIRAC/MonitoringSystem/private/Plotters/WMSHistoryPlotter.py diff --git a/MonitoringSystem/private/Plotters/__init__.py b/src/DIRAC/MonitoringSystem/private/Plotters/__init__.py similarity index 100% rename from MonitoringSystem/private/Plotters/__init__.py rename to src/DIRAC/MonitoringSystem/private/Plotters/__init__.py diff --git a/MonitoringSystem/private/__init__.py b/src/DIRAC/MonitoringSystem/private/__init__.py similarity index 100% rename from MonitoringSystem/private/__init__.py rename to src/DIRAC/MonitoringSystem/private/__init__.py diff --git a/ProductionSystem/Client/ProductionClient.py b/src/DIRAC/ProductionSystem/Client/ProductionClient.py similarity index 100% rename from ProductionSystem/Client/ProductionClient.py rename to src/DIRAC/ProductionSystem/Client/ProductionClient.py diff --git a/ProductionSystem/Client/ProductionStep.py b/src/DIRAC/ProductionSystem/Client/ProductionStep.py similarity index 100% rename from ProductionSystem/Client/ProductionStep.py rename to src/DIRAC/ProductionSystem/Client/ProductionStep.py diff --git a/ProductionSystem/Client/__init__.py b/src/DIRAC/ProductionSystem/Client/__init__.py similarity index 100% rename from ProductionSystem/Client/__init__.py rename to src/DIRAC/ProductionSystem/Client/__init__.py diff --git a/ProductionSystem/ConfigTemplate.cfg b/src/DIRAC/ProductionSystem/ConfigTemplate.cfg similarity index 100% rename from ProductionSystem/ConfigTemplate.cfg rename to src/DIRAC/ProductionSystem/ConfigTemplate.cfg diff --git a/ProductionSystem/DB/ProductionDB.py b/src/DIRAC/ProductionSystem/DB/ProductionDB.py similarity index 100% rename from ProductionSystem/DB/ProductionDB.py rename to src/DIRAC/ProductionSystem/DB/ProductionDB.py diff --git a/ProductionSystem/DB/ProductionDB.sql b/src/DIRAC/ProductionSystem/DB/ProductionDB.sql similarity index 100% rename from ProductionSystem/DB/ProductionDB.sql rename to src/DIRAC/ProductionSystem/DB/ProductionDB.sql diff --git a/ProductionSystem/DB/__init__.py b/src/DIRAC/ProductionSystem/DB/__init__.py similarity index 100% rename from ProductionSystem/DB/__init__.py rename to src/DIRAC/ProductionSystem/DB/__init__.py diff --git a/ProductionSystem/Service/ProductionManagerHandler.py b/src/DIRAC/ProductionSystem/Service/ProductionManagerHandler.py similarity index 100% rename from ProductionSystem/Service/ProductionManagerHandler.py rename to src/DIRAC/ProductionSystem/Service/ProductionManagerHandler.py diff --git a/ProductionSystem/Service/__init__.py b/src/DIRAC/ProductionSystem/Service/__init__.py similarity index 100% rename from ProductionSystem/Service/__init__.py rename to src/DIRAC/ProductionSystem/Service/__init__.py diff --git a/ProductionSystem/Utilities/ProdTransManager.py b/src/DIRAC/ProductionSystem/Utilities/ProdTransManager.py similarity index 100% rename from ProductionSystem/Utilities/ProdTransManager.py rename to src/DIRAC/ProductionSystem/Utilities/ProdTransManager.py diff --git a/ProductionSystem/Utilities/ProdValidator.py b/src/DIRAC/ProductionSystem/Utilities/ProdValidator.py similarity index 100% rename from ProductionSystem/Utilities/ProdValidator.py rename to src/DIRAC/ProductionSystem/Utilities/ProdValidator.py diff --git a/ProductionSystem/Utilities/StateMachine.py b/src/DIRAC/ProductionSystem/Utilities/StateMachine.py similarity index 100% rename from ProductionSystem/Utilities/StateMachine.py rename to src/DIRAC/ProductionSystem/Utilities/StateMachine.py diff --git a/ProductionSystem/Utilities/__init__.py b/src/DIRAC/ProductionSystem/Utilities/__init__.py similarity index 100% rename from ProductionSystem/Utilities/__init__.py rename to src/DIRAC/ProductionSystem/Utilities/__init__.py diff --git a/ProductionSystem/__init__.py b/src/DIRAC/ProductionSystem/__init__.py similarity index 100% rename from ProductionSystem/__init__.py rename to src/DIRAC/ProductionSystem/__init__.py diff --git a/ProductionSystem/scripts/dirac-prod-add-trans.py b/src/DIRAC/ProductionSystem/scripts/dirac-prod-add-trans.py similarity index 100% rename from ProductionSystem/scripts/dirac-prod-add-trans.py rename to src/DIRAC/ProductionSystem/scripts/dirac-prod-add-trans.py diff --git a/ProductionSystem/scripts/dirac-prod-clean.py b/src/DIRAC/ProductionSystem/scripts/dirac-prod-clean.py similarity index 100% rename from ProductionSystem/scripts/dirac-prod-clean.py rename to src/DIRAC/ProductionSystem/scripts/dirac-prod-clean.py diff --git a/ProductionSystem/scripts/dirac-prod-delete.py b/src/DIRAC/ProductionSystem/scripts/dirac-prod-delete.py similarity index 100% rename from ProductionSystem/scripts/dirac-prod-delete.py rename to src/DIRAC/ProductionSystem/scripts/dirac-prod-delete.py diff --git a/ProductionSystem/scripts/dirac-prod-get-all.py b/src/DIRAC/ProductionSystem/scripts/dirac-prod-get-all.py similarity index 100% rename from ProductionSystem/scripts/dirac-prod-get-all.py rename to src/DIRAC/ProductionSystem/scripts/dirac-prod-get-all.py diff --git a/ProductionSystem/scripts/dirac-prod-get-description.py b/src/DIRAC/ProductionSystem/scripts/dirac-prod-get-description.py similarity index 100% rename from ProductionSystem/scripts/dirac-prod-get-description.py rename to src/DIRAC/ProductionSystem/scripts/dirac-prod-get-description.py diff --git a/ProductionSystem/scripts/dirac-prod-get-trans.py b/src/DIRAC/ProductionSystem/scripts/dirac-prod-get-trans.py similarity index 100% rename from ProductionSystem/scripts/dirac-prod-get-trans.py rename to src/DIRAC/ProductionSystem/scripts/dirac-prod-get-trans.py diff --git a/ProductionSystem/scripts/dirac-prod-get.py b/src/DIRAC/ProductionSystem/scripts/dirac-prod-get.py similarity index 100% rename from ProductionSystem/scripts/dirac-prod-get.py rename to src/DIRAC/ProductionSystem/scripts/dirac-prod-get.py diff --git a/ProductionSystem/scripts/dirac-prod-start.py b/src/DIRAC/ProductionSystem/scripts/dirac-prod-start.py similarity index 100% rename from ProductionSystem/scripts/dirac-prod-start.py rename to src/DIRAC/ProductionSystem/scripts/dirac-prod-start.py diff --git a/ProductionSystem/scripts/dirac-prod-stop.py b/src/DIRAC/ProductionSystem/scripts/dirac-prod-stop.py similarity index 100% rename from ProductionSystem/scripts/dirac-prod-stop.py rename to src/DIRAC/ProductionSystem/scripts/dirac-prod-stop.py diff --git a/RequestManagementSystem/Agent/CleanReqDBAgent.py b/src/DIRAC/RequestManagementSystem/Agent/CleanReqDBAgent.py similarity index 100% rename from RequestManagementSystem/Agent/CleanReqDBAgent.py rename to src/DIRAC/RequestManagementSystem/Agent/CleanReqDBAgent.py diff --git a/RequestManagementSystem/Agent/RequestExecutingAgent.py b/src/DIRAC/RequestManagementSystem/Agent/RequestExecutingAgent.py similarity index 100% rename from RequestManagementSystem/Agent/RequestExecutingAgent.py rename to src/DIRAC/RequestManagementSystem/Agent/RequestExecutingAgent.py diff --git a/RequestManagementSystem/Agent/RequestOperations/ForwardDISET.py b/src/DIRAC/RequestManagementSystem/Agent/RequestOperations/ForwardDISET.py similarity index 100% rename from RequestManagementSystem/Agent/RequestOperations/ForwardDISET.py rename to src/DIRAC/RequestManagementSystem/Agent/RequestOperations/ForwardDISET.py diff --git a/RequestManagementSystem/Agent/RequestOperations/__init__.py b/src/DIRAC/RequestManagementSystem/Agent/RequestOperations/__init__.py similarity index 100% rename from RequestManagementSystem/Agent/RequestOperations/__init__.py rename to src/DIRAC/RequestManagementSystem/Agent/RequestOperations/__init__.py diff --git a/RequestManagementSystem/Agent/RequestOperations/test/ForwardDISETTests.py b/src/DIRAC/RequestManagementSystem/Agent/RequestOperations/test/ForwardDISETTests.py similarity index 100% rename from RequestManagementSystem/Agent/RequestOperations/test/ForwardDISETTests.py rename to src/DIRAC/RequestManagementSystem/Agent/RequestOperations/test/ForwardDISETTests.py diff --git a/RequestManagementSystem/Agent/__init__.py b/src/DIRAC/RequestManagementSystem/Agent/__init__.py similarity index 100% rename from RequestManagementSystem/Agent/__init__.py rename to src/DIRAC/RequestManagementSystem/Agent/__init__.py diff --git a/RequestManagementSystem/Client/File.py b/src/DIRAC/RequestManagementSystem/Client/File.py similarity index 100% rename from RequestManagementSystem/Client/File.py rename to src/DIRAC/RequestManagementSystem/Client/File.py diff --git a/RequestManagementSystem/Client/Operation.py b/src/DIRAC/RequestManagementSystem/Client/Operation.py similarity index 100% rename from RequestManagementSystem/Client/Operation.py rename to src/DIRAC/RequestManagementSystem/Client/Operation.py diff --git a/RequestManagementSystem/Client/ReqClient.py b/src/DIRAC/RequestManagementSystem/Client/ReqClient.py similarity index 100% rename from RequestManagementSystem/Client/ReqClient.py rename to src/DIRAC/RequestManagementSystem/Client/ReqClient.py diff --git a/RequestManagementSystem/Client/Request.py b/src/DIRAC/RequestManagementSystem/Client/Request.py similarity index 100% rename from RequestManagementSystem/Client/Request.py rename to src/DIRAC/RequestManagementSystem/Client/Request.py diff --git a/RequestManagementSystem/Client/__init__.py b/src/DIRAC/RequestManagementSystem/Client/__init__.py similarity index 100% rename from RequestManagementSystem/Client/__init__.py rename to src/DIRAC/RequestManagementSystem/Client/__init__.py diff --git a/RequestManagementSystem/Client/test/Test_File.py b/src/DIRAC/RequestManagementSystem/Client/test/Test_File.py similarity index 100% rename from RequestManagementSystem/Client/test/Test_File.py rename to src/DIRAC/RequestManagementSystem/Client/test/Test_File.py diff --git a/RequestManagementSystem/Client/test/Test_Operation.py b/src/DIRAC/RequestManagementSystem/Client/test/Test_Operation.py similarity index 100% rename from RequestManagementSystem/Client/test/Test_Operation.py rename to src/DIRAC/RequestManagementSystem/Client/test/Test_Operation.py diff --git a/RequestManagementSystem/Client/test/Test_Request.py b/src/DIRAC/RequestManagementSystem/Client/test/Test_Request.py similarity index 100% rename from RequestManagementSystem/Client/test/Test_Request.py rename to src/DIRAC/RequestManagementSystem/Client/test/Test_Request.py diff --git a/RequestManagementSystem/ConfigTemplate.cfg b/src/DIRAC/RequestManagementSystem/ConfigTemplate.cfg similarity index 100% rename from RequestManagementSystem/ConfigTemplate.cfg rename to src/DIRAC/RequestManagementSystem/ConfigTemplate.cfg diff --git a/RequestManagementSystem/DB/ReqDB.sql b/src/DIRAC/RequestManagementSystem/DB/ReqDB.sql similarity index 100% rename from RequestManagementSystem/DB/ReqDB.sql rename to src/DIRAC/RequestManagementSystem/DB/ReqDB.sql diff --git a/RequestManagementSystem/DB/RequestDB.py b/src/DIRAC/RequestManagementSystem/DB/RequestDB.py similarity index 100% rename from RequestManagementSystem/DB/RequestDB.py rename to src/DIRAC/RequestManagementSystem/DB/RequestDB.py diff --git a/RequestManagementSystem/DB/__init__.py b/src/DIRAC/RequestManagementSystem/DB/__init__.py similarity index 100% rename from RequestManagementSystem/DB/__init__.py rename to src/DIRAC/RequestManagementSystem/DB/__init__.py diff --git a/RequestManagementSystem/Service/ReqManagerHandler.py b/src/DIRAC/RequestManagementSystem/Service/ReqManagerHandler.py similarity index 100% rename from RequestManagementSystem/Service/ReqManagerHandler.py rename to src/DIRAC/RequestManagementSystem/Service/ReqManagerHandler.py diff --git a/RequestManagementSystem/Service/ReqProxyHandler.py b/src/DIRAC/RequestManagementSystem/Service/ReqProxyHandler.py similarity index 100% rename from RequestManagementSystem/Service/ReqProxyHandler.py rename to src/DIRAC/RequestManagementSystem/Service/ReqProxyHandler.py diff --git a/RequestManagementSystem/Service/__init__.py b/src/DIRAC/RequestManagementSystem/Service/__init__.py similarity index 100% rename from RequestManagementSystem/Service/__init__.py rename to src/DIRAC/RequestManagementSystem/Service/__init__.py diff --git a/RequestManagementSystem/Service/test/OperationHandlerBaseTests.py b/src/DIRAC/RequestManagementSystem/Service/test/OperationHandlerBaseTests.py similarity index 100% rename from RequestManagementSystem/Service/test/OperationHandlerBaseTests.py rename to src/DIRAC/RequestManagementSystem/Service/test/OperationHandlerBaseTests.py diff --git a/RequestManagementSystem/__init__.py b/src/DIRAC/RequestManagementSystem/__init__.py similarity index 100% rename from RequestManagementSystem/__init__.py rename to src/DIRAC/RequestManagementSystem/__init__.py diff --git a/RequestManagementSystem/private/JSONUtils.py b/src/DIRAC/RequestManagementSystem/private/JSONUtils.py similarity index 100% rename from RequestManagementSystem/private/JSONUtils.py rename to src/DIRAC/RequestManagementSystem/private/JSONUtils.py diff --git a/RequestManagementSystem/private/OperationHandlerBase.py b/src/DIRAC/RequestManagementSystem/private/OperationHandlerBase.py similarity index 100% rename from RequestManagementSystem/private/OperationHandlerBase.py rename to src/DIRAC/RequestManagementSystem/private/OperationHandlerBase.py diff --git a/RequestManagementSystem/private/RequestTask.py b/src/DIRAC/RequestManagementSystem/private/RequestTask.py similarity index 100% rename from RequestManagementSystem/private/RequestTask.py rename to src/DIRAC/RequestManagementSystem/private/RequestTask.py diff --git a/RequestManagementSystem/private/RequestValidator.py b/src/DIRAC/RequestManagementSystem/private/RequestValidator.py similarity index 100% rename from RequestManagementSystem/private/RequestValidator.py rename to src/DIRAC/RequestManagementSystem/private/RequestValidator.py diff --git a/RequestManagementSystem/private/__init__.py b/src/DIRAC/RequestManagementSystem/private/__init__.py similarity index 100% rename from RequestManagementSystem/private/__init__.py rename to src/DIRAC/RequestManagementSystem/private/__init__.py diff --git a/RequestManagementSystem/private/test/RequestTaskTests.py b/src/DIRAC/RequestManagementSystem/private/test/RequestTaskTests.py similarity index 100% rename from RequestManagementSystem/private/test/RequestTaskTests.py rename to src/DIRAC/RequestManagementSystem/private/test/RequestTaskTests.py diff --git a/RequestManagementSystem/private/test/RequestValidatorTests.py b/src/DIRAC/RequestManagementSystem/private/test/RequestValidatorTests.py similarity index 100% rename from RequestManagementSystem/private/test/RequestValidatorTests.py rename to src/DIRAC/RequestManagementSystem/private/test/RequestValidatorTests.py diff --git a/RequestManagementSystem/scripts/dirac-rms-list-req-cache.py b/src/DIRAC/RequestManagementSystem/scripts/dirac-rms-list-req-cache.py similarity index 100% rename from RequestManagementSystem/scripts/dirac-rms-list-req-cache.py rename to src/DIRAC/RequestManagementSystem/scripts/dirac-rms-list-req-cache.py diff --git a/RequestManagementSystem/scripts/dirac-rms-reqdb-summary.py b/src/DIRAC/RequestManagementSystem/scripts/dirac-rms-reqdb-summary.py similarity index 100% rename from RequestManagementSystem/scripts/dirac-rms-reqdb-summary.py rename to src/DIRAC/RequestManagementSystem/scripts/dirac-rms-reqdb-summary.py diff --git a/RequestManagementSystem/scripts/dirac-rms-request.py b/src/DIRAC/RequestManagementSystem/scripts/dirac-rms-request.py similarity index 100% rename from RequestManagementSystem/scripts/dirac-rms-request.py rename to src/DIRAC/RequestManagementSystem/scripts/dirac-rms-request.py diff --git a/ResourceStatusSystem/.project b/src/DIRAC/ResourceStatusSystem/.project similarity index 100% rename from ResourceStatusSystem/.project rename to src/DIRAC/ResourceStatusSystem/.project diff --git a/ResourceStatusSystem/.pydevproject b/src/DIRAC/ResourceStatusSystem/.pydevproject similarity index 100% rename from ResourceStatusSystem/.pydevproject rename to src/DIRAC/ResourceStatusSystem/.pydevproject diff --git a/ResourceStatusSystem/Agent/CacheFeederAgent.py b/src/DIRAC/ResourceStatusSystem/Agent/CacheFeederAgent.py similarity index 100% rename from ResourceStatusSystem/Agent/CacheFeederAgent.py rename to src/DIRAC/ResourceStatusSystem/Agent/CacheFeederAgent.py diff --git a/ResourceStatusSystem/Agent/ElementInspectorAgent.py b/src/DIRAC/ResourceStatusSystem/Agent/ElementInspectorAgent.py similarity index 100% rename from ResourceStatusSystem/Agent/ElementInspectorAgent.py rename to src/DIRAC/ResourceStatusSystem/Agent/ElementInspectorAgent.py diff --git a/ResourceStatusSystem/Agent/EmailAgent.py b/src/DIRAC/ResourceStatusSystem/Agent/EmailAgent.py similarity index 100% rename from ResourceStatusSystem/Agent/EmailAgent.py rename to src/DIRAC/ResourceStatusSystem/Agent/EmailAgent.py diff --git a/ResourceStatusSystem/Agent/SiteInspectorAgent.py b/src/DIRAC/ResourceStatusSystem/Agent/SiteInspectorAgent.py similarity index 100% rename from ResourceStatusSystem/Agent/SiteInspectorAgent.py rename to src/DIRAC/ResourceStatusSystem/Agent/SiteInspectorAgent.py diff --git a/ResourceStatusSystem/Agent/SummarizeLogsAgent.py b/src/DIRAC/ResourceStatusSystem/Agent/SummarizeLogsAgent.py similarity index 100% rename from ResourceStatusSystem/Agent/SummarizeLogsAgent.py rename to src/DIRAC/ResourceStatusSystem/Agent/SummarizeLogsAgent.py diff --git a/ResourceStatusSystem/Agent/TokenAgent.py b/src/DIRAC/ResourceStatusSystem/Agent/TokenAgent.py similarity index 100% rename from ResourceStatusSystem/Agent/TokenAgent.py rename to src/DIRAC/ResourceStatusSystem/Agent/TokenAgent.py diff --git a/ResourceStatusSystem/Agent/__init__.py b/src/DIRAC/ResourceStatusSystem/Agent/__init__.py similarity index 100% rename from ResourceStatusSystem/Agent/__init__.py rename to src/DIRAC/ResourceStatusSystem/Agent/__init__.py diff --git a/ResourceStatusSystem/Agent/test/Test_Agent_ElementInspectorAgent.py b/src/DIRAC/ResourceStatusSystem/Agent/test/Test_Agent_ElementInspectorAgent.py similarity index 100% rename from ResourceStatusSystem/Agent/test/Test_Agent_ElementInspectorAgent.py rename to src/DIRAC/ResourceStatusSystem/Agent/test/Test_Agent_ElementInspectorAgent.py diff --git a/ResourceStatusSystem/Agent/test/Test_Agent_ResourceStatusSystem.py b/src/DIRAC/ResourceStatusSystem/Agent/test/Test_Agent_ResourceStatusSystem.py similarity index 100% rename from ResourceStatusSystem/Agent/test/Test_Agent_ResourceStatusSystem.py rename to src/DIRAC/ResourceStatusSystem/Agent/test/Test_Agent_ResourceStatusSystem.py diff --git a/ResourceStatusSystem/Agent/test/Test_Agent_SiteInspectorAgent.py b/src/DIRAC/ResourceStatusSystem/Agent/test/Test_Agent_SiteInspectorAgent.py similarity index 100% rename from ResourceStatusSystem/Agent/test/Test_Agent_SiteInspectorAgent.py rename to src/DIRAC/ResourceStatusSystem/Agent/test/Test_Agent_SiteInspectorAgent.py diff --git a/ResourceStatusSystem/Client/PublisherClient.py b/src/DIRAC/ResourceStatusSystem/Client/PublisherClient.py similarity index 100% rename from ResourceStatusSystem/Client/PublisherClient.py rename to src/DIRAC/ResourceStatusSystem/Client/PublisherClient.py diff --git a/ResourceStatusSystem/Client/ResourceManagementClient.py b/src/DIRAC/ResourceStatusSystem/Client/ResourceManagementClient.py similarity index 100% rename from ResourceStatusSystem/Client/ResourceManagementClient.py rename to src/DIRAC/ResourceStatusSystem/Client/ResourceManagementClient.py diff --git a/ResourceStatusSystem/Client/ResourceStatus.py b/src/DIRAC/ResourceStatusSystem/Client/ResourceStatus.py similarity index 100% rename from ResourceStatusSystem/Client/ResourceStatus.py rename to src/DIRAC/ResourceStatusSystem/Client/ResourceStatus.py diff --git a/ResourceStatusSystem/Client/ResourceStatusClient.py b/src/DIRAC/ResourceStatusSystem/Client/ResourceStatusClient.py similarity index 100% rename from ResourceStatusSystem/Client/ResourceStatusClient.py rename to src/DIRAC/ResourceStatusSystem/Client/ResourceStatusClient.py diff --git a/ResourceStatusSystem/Client/SiteStatus.py b/src/DIRAC/ResourceStatusSystem/Client/SiteStatus.py similarity index 100% rename from ResourceStatusSystem/Client/SiteStatus.py rename to src/DIRAC/ResourceStatusSystem/Client/SiteStatus.py diff --git a/ResourceStatusSystem/Client/__init__.py b/src/DIRAC/ResourceStatusSystem/Client/__init__.py similarity index 100% rename from ResourceStatusSystem/Client/__init__.py rename to src/DIRAC/ResourceStatusSystem/Client/__init__.py diff --git a/ResourceStatusSystem/Command/AccountingCacheCommand.py b/src/DIRAC/ResourceStatusSystem/Command/AccountingCacheCommand.py similarity index 100% rename from ResourceStatusSystem/Command/AccountingCacheCommand.py rename to src/DIRAC/ResourceStatusSystem/Command/AccountingCacheCommand.py diff --git a/ResourceStatusSystem/Command/CEAvailabilityCommand.py b/src/DIRAC/ResourceStatusSystem/Command/CEAvailabilityCommand.py similarity index 100% rename from ResourceStatusSystem/Command/CEAvailabilityCommand.py rename to src/DIRAC/ResourceStatusSystem/Command/CEAvailabilityCommand.py diff --git a/ResourceStatusSystem/Command/Command.py b/src/DIRAC/ResourceStatusSystem/Command/Command.py similarity index 100% rename from ResourceStatusSystem/Command/Command.py rename to src/DIRAC/ResourceStatusSystem/Command/Command.py diff --git a/ResourceStatusSystem/Command/CommandCaller.py b/src/DIRAC/ResourceStatusSystem/Command/CommandCaller.py similarity index 100% rename from ResourceStatusSystem/Command/CommandCaller.py rename to src/DIRAC/ResourceStatusSystem/Command/CommandCaller.py diff --git a/ResourceStatusSystem/Command/DIRACAccountingCommand.py b/src/DIRAC/ResourceStatusSystem/Command/DIRACAccountingCommand.py similarity index 100% rename from ResourceStatusSystem/Command/DIRACAccountingCommand.py rename to src/DIRAC/ResourceStatusSystem/Command/DIRACAccountingCommand.py diff --git a/ResourceStatusSystem/Command/DowntimeCommand.py b/src/DIRAC/ResourceStatusSystem/Command/DowntimeCommand.py similarity index 100% rename from ResourceStatusSystem/Command/DowntimeCommand.py rename to src/DIRAC/ResourceStatusSystem/Command/DowntimeCommand.py diff --git a/ResourceStatusSystem/Command/FreeDiskSpaceCommand.py b/src/DIRAC/ResourceStatusSystem/Command/FreeDiskSpaceCommand.py similarity index 100% rename from ResourceStatusSystem/Command/FreeDiskSpaceCommand.py rename to src/DIRAC/ResourceStatusSystem/Command/FreeDiskSpaceCommand.py diff --git a/ResourceStatusSystem/Command/GGUSTicketsCommand.py b/src/DIRAC/ResourceStatusSystem/Command/GGUSTicketsCommand.py similarity index 100% rename from ResourceStatusSystem/Command/GGUSTicketsCommand.py rename to src/DIRAC/ResourceStatusSystem/Command/GGUSTicketsCommand.py diff --git a/ResourceStatusSystem/Command/GOCDBSyncCommand.py b/src/DIRAC/ResourceStatusSystem/Command/GOCDBSyncCommand.py similarity index 100% rename from ResourceStatusSystem/Command/GOCDBSyncCommand.py rename to src/DIRAC/ResourceStatusSystem/Command/GOCDBSyncCommand.py diff --git a/ResourceStatusSystem/Command/JobCommand.py b/src/DIRAC/ResourceStatusSystem/Command/JobCommand.py similarity index 100% rename from ResourceStatusSystem/Command/JobCommand.py rename to src/DIRAC/ResourceStatusSystem/Command/JobCommand.py diff --git a/ResourceStatusSystem/Command/MacroCommand.py b/src/DIRAC/ResourceStatusSystem/Command/MacroCommand.py similarity index 100% rename from ResourceStatusSystem/Command/MacroCommand.py rename to src/DIRAC/ResourceStatusSystem/Command/MacroCommand.py diff --git a/ResourceStatusSystem/Command/PilotCommand.py b/src/DIRAC/ResourceStatusSystem/Command/PilotCommand.py similarity index 100% rename from ResourceStatusSystem/Command/PilotCommand.py rename to src/DIRAC/ResourceStatusSystem/Command/PilotCommand.py diff --git a/ResourceStatusSystem/Command/PropagationCommand.py b/src/DIRAC/ResourceStatusSystem/Command/PropagationCommand.py similarity index 100% rename from ResourceStatusSystem/Command/PropagationCommand.py rename to src/DIRAC/ResourceStatusSystem/Command/PropagationCommand.py diff --git a/ResourceStatusSystem/Command/TransferCommand.py b/src/DIRAC/ResourceStatusSystem/Command/TransferCommand.py similarity index 100% rename from ResourceStatusSystem/Command/TransferCommand.py rename to src/DIRAC/ResourceStatusSystem/Command/TransferCommand.py diff --git a/ResourceStatusSystem/Command/VOBOXAvailabilityCommand.py b/src/DIRAC/ResourceStatusSystem/Command/VOBOXAvailabilityCommand.py similarity index 100% rename from ResourceStatusSystem/Command/VOBOXAvailabilityCommand.py rename to src/DIRAC/ResourceStatusSystem/Command/VOBOXAvailabilityCommand.py diff --git a/ResourceStatusSystem/Command/__init__.py b/src/DIRAC/ResourceStatusSystem/Command/__init__.py similarity index 100% rename from ResourceStatusSystem/Command/__init__.py rename to src/DIRAC/ResourceStatusSystem/Command/__init__.py diff --git a/ResourceStatusSystem/Command/test/Test_RSS_Command_CEAvailabilityCommand.py b/src/DIRAC/ResourceStatusSystem/Command/test/Test_RSS_Command_CEAvailabilityCommand.py similarity index 100% rename from ResourceStatusSystem/Command/test/Test_RSS_Command_CEAvailabilityCommand.py rename to src/DIRAC/ResourceStatusSystem/Command/test/Test_RSS_Command_CEAvailabilityCommand.py diff --git a/ResourceStatusSystem/Command/test/Test_RSS_Command_GOCDBStatusCommand.py b/src/DIRAC/ResourceStatusSystem/Command/test/Test_RSS_Command_GOCDBStatusCommand.py similarity index 100% rename from ResourceStatusSystem/Command/test/Test_RSS_Command_GOCDBStatusCommand.py rename to src/DIRAC/ResourceStatusSystem/Command/test/Test_RSS_Command_GOCDBStatusCommand.py diff --git a/ResourceStatusSystem/Command/test/Test_RSS_Command_GOCDBSyncCommand.py b/src/DIRAC/ResourceStatusSystem/Command/test/Test_RSS_Command_GOCDBSyncCommand.py similarity index 100% rename from ResourceStatusSystem/Command/test/Test_RSS_Command_GOCDBSyncCommand.py rename to src/DIRAC/ResourceStatusSystem/Command/test/Test_RSS_Command_GOCDBSyncCommand.py diff --git a/ResourceStatusSystem/Command/test/Test_RSS_Command_VOBOXAvailabilityCommand.py b/src/DIRAC/ResourceStatusSystem/Command/test/Test_RSS_Command_VOBOXAvailabilityCommand.py similarity index 100% rename from ResourceStatusSystem/Command/test/Test_RSS_Command_VOBOXAvailabilityCommand.py rename to src/DIRAC/ResourceStatusSystem/Command/test/Test_RSS_Command_VOBOXAvailabilityCommand.py diff --git a/ResourceStatusSystem/ConfigTemplate.cfg b/src/DIRAC/ResourceStatusSystem/ConfigTemplate.cfg similarity index 100% rename from ResourceStatusSystem/ConfigTemplate.cfg rename to src/DIRAC/ResourceStatusSystem/ConfigTemplate.cfg diff --git a/ResourceStatusSystem/DB/ResourceManagementDB.py b/src/DIRAC/ResourceStatusSystem/DB/ResourceManagementDB.py similarity index 100% rename from ResourceStatusSystem/DB/ResourceManagementDB.py rename to src/DIRAC/ResourceStatusSystem/DB/ResourceManagementDB.py diff --git a/ResourceStatusSystem/DB/ResourceManagementDB.sql b/src/DIRAC/ResourceStatusSystem/DB/ResourceManagementDB.sql similarity index 100% rename from ResourceStatusSystem/DB/ResourceManagementDB.sql rename to src/DIRAC/ResourceStatusSystem/DB/ResourceManagementDB.sql diff --git a/ResourceStatusSystem/DB/ResourceStatusDB.py b/src/DIRAC/ResourceStatusSystem/DB/ResourceStatusDB.py similarity index 100% rename from ResourceStatusSystem/DB/ResourceStatusDB.py rename to src/DIRAC/ResourceStatusSystem/DB/ResourceStatusDB.py diff --git a/ResourceStatusSystem/DB/ResourceStatusDB.sql b/src/DIRAC/ResourceStatusSystem/DB/ResourceStatusDB.sql similarity index 100% rename from ResourceStatusSystem/DB/ResourceStatusDB.sql rename to src/DIRAC/ResourceStatusSystem/DB/ResourceStatusDB.sql diff --git a/ResourceStatusSystem/DB/__init__.py b/src/DIRAC/ResourceStatusSystem/DB/__init__.py similarity index 100% rename from ResourceStatusSystem/DB/__init__.py rename to src/DIRAC/ResourceStatusSystem/DB/__init__.py diff --git a/ResourceStatusSystem/Policy/AlwaysActivePolicy.py b/src/DIRAC/ResourceStatusSystem/Policy/AlwaysActivePolicy.py similarity index 100% rename from ResourceStatusSystem/Policy/AlwaysActivePolicy.py rename to src/DIRAC/ResourceStatusSystem/Policy/AlwaysActivePolicy.py diff --git a/ResourceStatusSystem/Policy/AlwaysBannedPolicy.py b/src/DIRAC/ResourceStatusSystem/Policy/AlwaysBannedPolicy.py similarity index 100% rename from ResourceStatusSystem/Policy/AlwaysBannedPolicy.py rename to src/DIRAC/ResourceStatusSystem/Policy/AlwaysBannedPolicy.py diff --git a/ResourceStatusSystem/Policy/AlwaysDegradedPolicy.py b/src/DIRAC/ResourceStatusSystem/Policy/AlwaysDegradedPolicy.py similarity index 100% rename from ResourceStatusSystem/Policy/AlwaysDegradedPolicy.py rename to src/DIRAC/ResourceStatusSystem/Policy/AlwaysDegradedPolicy.py diff --git a/ResourceStatusSystem/Policy/AlwaysProbingPolicy.py b/src/DIRAC/ResourceStatusSystem/Policy/AlwaysProbingPolicy.py similarity index 100% rename from ResourceStatusSystem/Policy/AlwaysProbingPolicy.py rename to src/DIRAC/ResourceStatusSystem/Policy/AlwaysProbingPolicy.py diff --git a/ResourceStatusSystem/Policy/CEAvailabilityPolicy.py b/src/DIRAC/ResourceStatusSystem/Policy/CEAvailabilityPolicy.py similarity index 100% rename from ResourceStatusSystem/Policy/CEAvailabilityPolicy.py rename to src/DIRAC/ResourceStatusSystem/Policy/CEAvailabilityPolicy.py diff --git a/ResourceStatusSystem/Policy/Configurations.py b/src/DIRAC/ResourceStatusSystem/Policy/Configurations.py similarity index 100% rename from ResourceStatusSystem/Policy/Configurations.py rename to src/DIRAC/ResourceStatusSystem/Policy/Configurations.py diff --git a/ResourceStatusSystem/Policy/DowntimePolicy.py b/src/DIRAC/ResourceStatusSystem/Policy/DowntimePolicy.py similarity index 100% rename from ResourceStatusSystem/Policy/DowntimePolicy.py rename to src/DIRAC/ResourceStatusSystem/Policy/DowntimePolicy.py diff --git a/ResourceStatusSystem/Policy/FreeDiskSpacePolicy.py b/src/DIRAC/ResourceStatusSystem/Policy/FreeDiskSpacePolicy.py similarity index 100% rename from ResourceStatusSystem/Policy/FreeDiskSpacePolicy.py rename to src/DIRAC/ResourceStatusSystem/Policy/FreeDiskSpacePolicy.py diff --git a/ResourceStatusSystem/Policy/GGUSTicketsPolicy.py b/src/DIRAC/ResourceStatusSystem/Policy/GGUSTicketsPolicy.py similarity index 100% rename from ResourceStatusSystem/Policy/GGUSTicketsPolicy.py rename to src/DIRAC/ResourceStatusSystem/Policy/GGUSTicketsPolicy.py diff --git a/ResourceStatusSystem/Policy/JobDoneRatioPolicy.py b/src/DIRAC/ResourceStatusSystem/Policy/JobDoneRatioPolicy.py similarity index 100% rename from ResourceStatusSystem/Policy/JobDoneRatioPolicy.py rename to src/DIRAC/ResourceStatusSystem/Policy/JobDoneRatioPolicy.py diff --git a/ResourceStatusSystem/Policy/JobEfficiencyPolicy.py b/src/DIRAC/ResourceStatusSystem/Policy/JobEfficiencyPolicy.py similarity index 100% rename from ResourceStatusSystem/Policy/JobEfficiencyPolicy.py rename to src/DIRAC/ResourceStatusSystem/Policy/JobEfficiencyPolicy.py diff --git a/ResourceStatusSystem/Policy/JobRunningMatchedRatioPolicy.py b/src/DIRAC/ResourceStatusSystem/Policy/JobRunningMatchedRatioPolicy.py similarity index 100% rename from ResourceStatusSystem/Policy/JobRunningMatchedRatioPolicy.py rename to src/DIRAC/ResourceStatusSystem/Policy/JobRunningMatchedRatioPolicy.py diff --git a/ResourceStatusSystem/Policy/JobRunningWaitingRatioPolicy.py b/src/DIRAC/ResourceStatusSystem/Policy/JobRunningWaitingRatioPolicy.py similarity index 100% rename from ResourceStatusSystem/Policy/JobRunningWaitingRatioPolicy.py rename to src/DIRAC/ResourceStatusSystem/Policy/JobRunningWaitingRatioPolicy.py diff --git a/ResourceStatusSystem/Policy/PilotEfficiencyPolicy.py b/src/DIRAC/ResourceStatusSystem/Policy/PilotEfficiencyPolicy.py similarity index 100% rename from ResourceStatusSystem/Policy/PilotEfficiencyPolicy.py rename to src/DIRAC/ResourceStatusSystem/Policy/PilotEfficiencyPolicy.py diff --git a/ResourceStatusSystem/Policy/PropagationPolicy.py b/src/DIRAC/ResourceStatusSystem/Policy/PropagationPolicy.py similarity index 100% rename from ResourceStatusSystem/Policy/PropagationPolicy.py rename to src/DIRAC/ResourceStatusSystem/Policy/PropagationPolicy.py diff --git a/ResourceStatusSystem/Policy/__init__.py b/src/DIRAC/ResourceStatusSystem/Policy/__init__.py similarity index 100% rename from ResourceStatusSystem/Policy/__init__.py rename to src/DIRAC/ResourceStatusSystem/Policy/__init__.py diff --git a/ResourceStatusSystem/Policy/test/Test_RSS_Policy_AlwaysActivePolicy.py b/src/DIRAC/ResourceStatusSystem/Policy/test/Test_RSS_Policy_AlwaysActivePolicy.py similarity index 100% rename from ResourceStatusSystem/Policy/test/Test_RSS_Policy_AlwaysActivePolicy.py rename to src/DIRAC/ResourceStatusSystem/Policy/test/Test_RSS_Policy_AlwaysActivePolicy.py diff --git a/ResourceStatusSystem/Policy/test/Test_RSS_Policy_CEAvailabilityPolicy.py b/src/DIRAC/ResourceStatusSystem/Policy/test/Test_RSS_Policy_CEAvailabilityPolicy.py similarity index 100% rename from ResourceStatusSystem/Policy/test/Test_RSS_Policy_CEAvailabilityPolicy.py rename to src/DIRAC/ResourceStatusSystem/Policy/test/Test_RSS_Policy_CEAvailabilityPolicy.py diff --git a/ResourceStatusSystem/Policy/test/Test_RSS_Policy_Configurations.py b/src/DIRAC/ResourceStatusSystem/Policy/test/Test_RSS_Policy_Configurations.py similarity index 100% rename from ResourceStatusSystem/Policy/test/Test_RSS_Policy_Configurations.py rename to src/DIRAC/ResourceStatusSystem/Policy/test/Test_RSS_Policy_Configurations.py diff --git a/ResourceStatusSystem/Policy/test/Test_RSS_Policy_DTPolicy.py b/src/DIRAC/ResourceStatusSystem/Policy/test/Test_RSS_Policy_DTPolicy.py similarity index 100% rename from ResourceStatusSystem/Policy/test/Test_RSS_Policy_DTPolicy.py rename to src/DIRAC/ResourceStatusSystem/Policy/test/Test_RSS_Policy_DTPolicy.py diff --git a/ResourceStatusSystem/Policy/test/Test_RSS_Policy_FreeDiskSpacePolicy.py b/src/DIRAC/ResourceStatusSystem/Policy/test/Test_RSS_Policy_FreeDiskSpacePolicy.py similarity index 100% rename from ResourceStatusSystem/Policy/test/Test_RSS_Policy_FreeDiskSpacePolicy.py rename to src/DIRAC/ResourceStatusSystem/Policy/test/Test_RSS_Policy_FreeDiskSpacePolicy.py diff --git a/ResourceStatusSystem/Policy/test/Test_RSS_Policy_GGUSTicketsPolicy.py b/src/DIRAC/ResourceStatusSystem/Policy/test/Test_RSS_Policy_GGUSTicketsPolicy.py similarity index 100% rename from ResourceStatusSystem/Policy/test/Test_RSS_Policy_GGUSTicketsPolicy.py rename to src/DIRAC/ResourceStatusSystem/Policy/test/Test_RSS_Policy_GGUSTicketsPolicy.py diff --git a/ResourceStatusSystem/Policy/test/Test_RSS_Policy_JobDoneRatioPolicy.py b/src/DIRAC/ResourceStatusSystem/Policy/test/Test_RSS_Policy_JobDoneRatioPolicy.py similarity index 100% rename from ResourceStatusSystem/Policy/test/Test_RSS_Policy_JobDoneRatioPolicy.py rename to src/DIRAC/ResourceStatusSystem/Policy/test/Test_RSS_Policy_JobDoneRatioPolicy.py diff --git a/ResourceStatusSystem/Policy/test/Test_RSS_Policy_JobEfficiencyPolicy.py b/src/DIRAC/ResourceStatusSystem/Policy/test/Test_RSS_Policy_JobEfficiencyPolicy.py similarity index 100% rename from ResourceStatusSystem/Policy/test/Test_RSS_Policy_JobEfficiencyPolicy.py rename to src/DIRAC/ResourceStatusSystem/Policy/test/Test_RSS_Policy_JobEfficiencyPolicy.py diff --git a/ResourceStatusSystem/Policy/test/Test_RSS_Policy_JobRunningMatchedRatioPolicy.py b/src/DIRAC/ResourceStatusSystem/Policy/test/Test_RSS_Policy_JobRunningMatchedRatioPolicy.py similarity index 100% rename from ResourceStatusSystem/Policy/test/Test_RSS_Policy_JobRunningMatchedRatioPolicy.py rename to src/DIRAC/ResourceStatusSystem/Policy/test/Test_RSS_Policy_JobRunningMatchedRatioPolicy.py diff --git a/ResourceStatusSystem/Policy/test/Test_RSS_Policy_JobRunningWaitingRatioPolicy.py b/src/DIRAC/ResourceStatusSystem/Policy/test/Test_RSS_Policy_JobRunningWaitingRatioPolicy.py similarity index 100% rename from ResourceStatusSystem/Policy/test/Test_RSS_Policy_JobRunningWaitingRatioPolicy.py rename to src/DIRAC/ResourceStatusSystem/Policy/test/Test_RSS_Policy_JobRunningWaitingRatioPolicy.py diff --git a/ResourceStatusSystem/Policy/test/Test_RSS_Policy_PilotEfficiencyPolicy.py b/src/DIRAC/ResourceStatusSystem/Policy/test/Test_RSS_Policy_PilotEfficiencyPolicy.py similarity index 100% rename from ResourceStatusSystem/Policy/test/Test_RSS_Policy_PilotEfficiencyPolicy.py rename to src/DIRAC/ResourceStatusSystem/Policy/test/Test_RSS_Policy_PilotEfficiencyPolicy.py diff --git a/ResourceStatusSystem/PolicySystem/Actions/BaseAction.py b/src/DIRAC/ResourceStatusSystem/PolicySystem/Actions/BaseAction.py similarity index 100% rename from ResourceStatusSystem/PolicySystem/Actions/BaseAction.py rename to src/DIRAC/ResourceStatusSystem/PolicySystem/Actions/BaseAction.py diff --git a/ResourceStatusSystem/PolicySystem/Actions/EmailAction.py b/src/DIRAC/ResourceStatusSystem/PolicySystem/Actions/EmailAction.py similarity index 100% rename from ResourceStatusSystem/PolicySystem/Actions/EmailAction.py rename to src/DIRAC/ResourceStatusSystem/PolicySystem/Actions/EmailAction.py diff --git a/ResourceStatusSystem/PolicySystem/Actions/LogPolicyResultAction.py b/src/DIRAC/ResourceStatusSystem/PolicySystem/Actions/LogPolicyResultAction.py similarity index 100% rename from ResourceStatusSystem/PolicySystem/Actions/LogPolicyResultAction.py rename to src/DIRAC/ResourceStatusSystem/PolicySystem/Actions/LogPolicyResultAction.py diff --git a/ResourceStatusSystem/PolicySystem/Actions/LogStatusAction.py b/src/DIRAC/ResourceStatusSystem/PolicySystem/Actions/LogStatusAction.py similarity index 100% rename from ResourceStatusSystem/PolicySystem/Actions/LogStatusAction.py rename to src/DIRAC/ResourceStatusSystem/PolicySystem/Actions/LogStatusAction.py diff --git a/ResourceStatusSystem/PolicySystem/Actions/SlackAction.py b/src/DIRAC/ResourceStatusSystem/PolicySystem/Actions/SlackAction.py similarity index 100% rename from ResourceStatusSystem/PolicySystem/Actions/SlackAction.py rename to src/DIRAC/ResourceStatusSystem/PolicySystem/Actions/SlackAction.py diff --git a/ResourceStatusSystem/PolicySystem/Actions/__init__.py b/src/DIRAC/ResourceStatusSystem/PolicySystem/Actions/__init__.py similarity index 100% rename from ResourceStatusSystem/PolicySystem/Actions/__init__.py rename to src/DIRAC/ResourceStatusSystem/PolicySystem/Actions/__init__.py diff --git a/ResourceStatusSystem/PolicySystem/PDP.py b/src/DIRAC/ResourceStatusSystem/PolicySystem/PDP.py similarity index 100% rename from ResourceStatusSystem/PolicySystem/PDP.py rename to src/DIRAC/ResourceStatusSystem/PolicySystem/PDP.py diff --git a/ResourceStatusSystem/PolicySystem/PEP.py b/src/DIRAC/ResourceStatusSystem/PolicySystem/PEP.py similarity index 100% rename from ResourceStatusSystem/PolicySystem/PEP.py rename to src/DIRAC/ResourceStatusSystem/PolicySystem/PEP.py diff --git a/ResourceStatusSystem/PolicySystem/PolicyBase.py b/src/DIRAC/ResourceStatusSystem/PolicySystem/PolicyBase.py similarity index 100% rename from ResourceStatusSystem/PolicySystem/PolicyBase.py rename to src/DIRAC/ResourceStatusSystem/PolicySystem/PolicyBase.py diff --git a/ResourceStatusSystem/PolicySystem/PolicyCaller.py b/src/DIRAC/ResourceStatusSystem/PolicySystem/PolicyCaller.py similarity index 100% rename from ResourceStatusSystem/PolicySystem/PolicyCaller.py rename to src/DIRAC/ResourceStatusSystem/PolicySystem/PolicyCaller.py diff --git a/ResourceStatusSystem/PolicySystem/StateMachine.py b/src/DIRAC/ResourceStatusSystem/PolicySystem/StateMachine.py similarity index 100% rename from ResourceStatusSystem/PolicySystem/StateMachine.py rename to src/DIRAC/ResourceStatusSystem/PolicySystem/StateMachine.py diff --git a/ResourceStatusSystem/PolicySystem/__init__.py b/src/DIRAC/ResourceStatusSystem/PolicySystem/__init__.py similarity index 100% rename from ResourceStatusSystem/PolicySystem/__init__.py rename to src/DIRAC/ResourceStatusSystem/PolicySystem/__init__.py diff --git a/ResourceStatusSystem/PolicySystem/test/Test_PolicySystem.py b/src/DIRAC/ResourceStatusSystem/PolicySystem/test/Test_PolicySystem.py similarity index 100% rename from ResourceStatusSystem/PolicySystem/test/Test_PolicySystem.py rename to src/DIRAC/ResourceStatusSystem/PolicySystem/test/Test_PolicySystem.py diff --git a/ResourceStatusSystem/Service/PublisherHandler.py b/src/DIRAC/ResourceStatusSystem/Service/PublisherHandler.py similarity index 100% rename from ResourceStatusSystem/Service/PublisherHandler.py rename to src/DIRAC/ResourceStatusSystem/Service/PublisherHandler.py diff --git a/ResourceStatusSystem/Service/ResourceManagementHandler.py b/src/DIRAC/ResourceStatusSystem/Service/ResourceManagementHandler.py similarity index 100% rename from ResourceStatusSystem/Service/ResourceManagementHandler.py rename to src/DIRAC/ResourceStatusSystem/Service/ResourceManagementHandler.py diff --git a/ResourceStatusSystem/Service/ResourceStatusHandler.py b/src/DIRAC/ResourceStatusSystem/Service/ResourceStatusHandler.py similarity index 100% rename from ResourceStatusSystem/Service/ResourceStatusHandler.py rename to src/DIRAC/ResourceStatusSystem/Service/ResourceStatusHandler.py diff --git a/ResourceStatusSystem/Service/__init__.py b/src/DIRAC/ResourceStatusSystem/Service/__init__.py similarity index 100% rename from ResourceStatusSystem/Service/__init__.py rename to src/DIRAC/ResourceStatusSystem/Service/__init__.py diff --git a/ResourceStatusSystem/Utilities/CSHelpers.py b/src/DIRAC/ResourceStatusSystem/Utilities/CSHelpers.py similarity index 100% rename from ResourceStatusSystem/Utilities/CSHelpers.py rename to src/DIRAC/ResourceStatusSystem/Utilities/CSHelpers.py diff --git a/ResourceStatusSystem/Utilities/InfoGetter.py b/src/DIRAC/ResourceStatusSystem/Utilities/InfoGetter.py similarity index 100% rename from ResourceStatusSystem/Utilities/InfoGetter.py rename to src/DIRAC/ResourceStatusSystem/Utilities/InfoGetter.py diff --git a/ResourceStatusSystem/Utilities/RSSCache.py b/src/DIRAC/ResourceStatusSystem/Utilities/RSSCache.py similarity index 100% rename from ResourceStatusSystem/Utilities/RSSCache.py rename to src/DIRAC/ResourceStatusSystem/Utilities/RSSCache.py diff --git a/ResourceStatusSystem/Utilities/RSSCacheNoThread.py b/src/DIRAC/ResourceStatusSystem/Utilities/RSSCacheNoThread.py similarity index 100% rename from ResourceStatusSystem/Utilities/RSSCacheNoThread.py rename to src/DIRAC/ResourceStatusSystem/Utilities/RSSCacheNoThread.py diff --git a/ResourceStatusSystem/Utilities/RssConfiguration.py b/src/DIRAC/ResourceStatusSystem/Utilities/RssConfiguration.py similarity index 100% rename from ResourceStatusSystem/Utilities/RssConfiguration.py rename to src/DIRAC/ResourceStatusSystem/Utilities/RssConfiguration.py diff --git a/ResourceStatusSystem/Utilities/Synchronizer.py b/src/DIRAC/ResourceStatusSystem/Utilities/Synchronizer.py similarity index 100% rename from ResourceStatusSystem/Utilities/Synchronizer.py rename to src/DIRAC/ResourceStatusSystem/Utilities/Synchronizer.py diff --git a/ResourceStatusSystem/Utilities/Utils.py b/src/DIRAC/ResourceStatusSystem/Utilities/Utils.py similarity index 100% rename from ResourceStatusSystem/Utilities/Utils.py rename to src/DIRAC/ResourceStatusSystem/Utilities/Utils.py diff --git a/ResourceStatusSystem/Utilities/__init__.py b/src/DIRAC/ResourceStatusSystem/Utilities/__init__.py similarity index 100% rename from ResourceStatusSystem/Utilities/__init__.py rename to src/DIRAC/ResourceStatusSystem/Utilities/__init__.py diff --git a/ResourceStatusSystem/__init__.py b/src/DIRAC/ResourceStatusSystem/__init__.py similarity index 100% rename from ResourceStatusSystem/__init__.py rename to src/DIRAC/ResourceStatusSystem/__init__.py diff --git a/ResourceStatusSystem/scripts/dirac-rss-list-status.py b/src/DIRAC/ResourceStatusSystem/scripts/dirac-rss-list-status.py similarity index 100% rename from ResourceStatusSystem/scripts/dirac-rss-list-status.py rename to src/DIRAC/ResourceStatusSystem/scripts/dirac-rss-list-status.py diff --git a/ResourceStatusSystem/scripts/dirac-rss-query-db.py b/src/DIRAC/ResourceStatusSystem/scripts/dirac-rss-query-db.py similarity index 100% rename from ResourceStatusSystem/scripts/dirac-rss-query-db.py rename to src/DIRAC/ResourceStatusSystem/scripts/dirac-rss-query-db.py diff --git a/ResourceStatusSystem/scripts/dirac-rss-query-dtcache.py b/src/DIRAC/ResourceStatusSystem/scripts/dirac-rss-query-dtcache.py similarity index 100% rename from ResourceStatusSystem/scripts/dirac-rss-query-dtcache.py rename to src/DIRAC/ResourceStatusSystem/scripts/dirac-rss-query-dtcache.py diff --git a/ResourceStatusSystem/scripts/dirac-rss-set-status.py b/src/DIRAC/ResourceStatusSystem/scripts/dirac-rss-set-status.py similarity index 100% rename from ResourceStatusSystem/scripts/dirac-rss-set-status.py rename to src/DIRAC/ResourceStatusSystem/scripts/dirac-rss-set-status.py diff --git a/ResourceStatusSystem/scripts/dirac-rss-set-token.py b/src/DIRAC/ResourceStatusSystem/scripts/dirac-rss-set-token.py similarity index 100% rename from ResourceStatusSystem/scripts/dirac-rss-set-token.py rename to src/DIRAC/ResourceStatusSystem/scripts/dirac-rss-set-token.py diff --git a/ResourceStatusSystem/scripts/dirac-rss-sync.py b/src/DIRAC/ResourceStatusSystem/scripts/dirac-rss-sync.py similarity index 100% rename from ResourceStatusSystem/scripts/dirac-rss-sync.py rename to src/DIRAC/ResourceStatusSystem/scripts/dirac-rss-sync.py diff --git a/Resources/Catalog/ConditionPlugins/DummyPlugin.py b/src/DIRAC/Resources/Catalog/ConditionPlugins/DummyPlugin.py similarity index 100% rename from Resources/Catalog/ConditionPlugins/DummyPlugin.py rename to src/DIRAC/Resources/Catalog/ConditionPlugins/DummyPlugin.py diff --git a/Resources/Catalog/ConditionPlugins/FCConditionBasePlugin.py b/src/DIRAC/Resources/Catalog/ConditionPlugins/FCConditionBasePlugin.py similarity index 100% rename from Resources/Catalog/ConditionPlugins/FCConditionBasePlugin.py rename to src/DIRAC/Resources/Catalog/ConditionPlugins/FCConditionBasePlugin.py diff --git a/Resources/Catalog/ConditionPlugins/FilenamePlugin.py b/src/DIRAC/Resources/Catalog/ConditionPlugins/FilenamePlugin.py similarity index 100% rename from Resources/Catalog/ConditionPlugins/FilenamePlugin.py rename to src/DIRAC/Resources/Catalog/ConditionPlugins/FilenamePlugin.py diff --git a/Resources/Catalog/ConditionPlugins/ProxyPlugin.py b/src/DIRAC/Resources/Catalog/ConditionPlugins/ProxyPlugin.py similarity index 100% rename from Resources/Catalog/ConditionPlugins/ProxyPlugin.py rename to src/DIRAC/Resources/Catalog/ConditionPlugins/ProxyPlugin.py diff --git a/Resources/Catalog/ConditionPlugins/__init__.py b/src/DIRAC/Resources/Catalog/ConditionPlugins/__init__.py similarity index 100% rename from Resources/Catalog/ConditionPlugins/__init__.py rename to src/DIRAC/Resources/Catalog/ConditionPlugins/__init__.py diff --git a/Resources/Catalog/ConditionPlugins/test/Test_FilenamePlugin.py b/src/DIRAC/Resources/Catalog/ConditionPlugins/test/Test_FilenamePlugin.py similarity index 100% rename from Resources/Catalog/ConditionPlugins/test/Test_FilenamePlugin.py rename to src/DIRAC/Resources/Catalog/ConditionPlugins/test/Test_FilenamePlugin.py diff --git a/Resources/Catalog/ConditionPlugins/test/Test_ProxyPlugin.py b/src/DIRAC/Resources/Catalog/ConditionPlugins/test/Test_ProxyPlugin.py similarity index 100% rename from Resources/Catalog/ConditionPlugins/test/Test_ProxyPlugin.py rename to src/DIRAC/Resources/Catalog/ConditionPlugins/test/Test_ProxyPlugin.py diff --git a/Resources/Catalog/ConditionPlugins/test/__init__.py b/src/DIRAC/Resources/Catalog/ConditionPlugins/test/__init__.py similarity index 100% rename from Resources/Catalog/ConditionPlugins/test/__init__.py rename to src/DIRAC/Resources/Catalog/ConditionPlugins/test/__init__.py diff --git a/Resources/Catalog/FCConditionParser.py b/src/DIRAC/Resources/Catalog/FCConditionParser.py similarity index 100% rename from Resources/Catalog/FCConditionParser.py rename to src/DIRAC/Resources/Catalog/FCConditionParser.py diff --git a/Resources/Catalog/FileCatalog.py b/src/DIRAC/Resources/Catalog/FileCatalog.py similarity index 100% rename from Resources/Catalog/FileCatalog.py rename to src/DIRAC/Resources/Catalog/FileCatalog.py diff --git a/Resources/Catalog/FileCatalogClient.py b/src/DIRAC/Resources/Catalog/FileCatalogClient.py similarity index 100% rename from Resources/Catalog/FileCatalogClient.py rename to src/DIRAC/Resources/Catalog/FileCatalogClient.py diff --git a/Resources/Catalog/FileCatalogClientBase.py b/src/DIRAC/Resources/Catalog/FileCatalogClientBase.py similarity index 100% rename from Resources/Catalog/FileCatalogClientBase.py rename to src/DIRAC/Resources/Catalog/FileCatalogClientBase.py diff --git a/Resources/Catalog/FileCatalogFactory.py b/src/DIRAC/Resources/Catalog/FileCatalogFactory.py similarity index 100% rename from Resources/Catalog/FileCatalogFactory.py rename to src/DIRAC/Resources/Catalog/FileCatalogFactory.py diff --git a/Resources/Catalog/FileCatalogProxyClient.py b/src/DIRAC/Resources/Catalog/FileCatalogProxyClient.py similarity index 100% rename from Resources/Catalog/FileCatalogProxyClient.py rename to src/DIRAC/Resources/Catalog/FileCatalogProxyClient.py diff --git a/Resources/Catalog/LcgFileCatalogClient.py b/src/DIRAC/Resources/Catalog/LcgFileCatalogClient.py similarity index 100% rename from Resources/Catalog/LcgFileCatalogClient.py rename to src/DIRAC/Resources/Catalog/LcgFileCatalogClient.py diff --git a/Resources/Catalog/PoolXMLCatalog.py b/src/DIRAC/Resources/Catalog/PoolXMLCatalog.py similarity index 100% rename from Resources/Catalog/PoolXMLCatalog.py rename to src/DIRAC/Resources/Catalog/PoolXMLCatalog.py diff --git a/Resources/Catalog/PoolXMLFile.py b/src/DIRAC/Resources/Catalog/PoolXMLFile.py similarity index 100% rename from Resources/Catalog/PoolXMLFile.py rename to src/DIRAC/Resources/Catalog/PoolXMLFile.py diff --git a/Resources/Catalog/TSCatalogClient.py b/src/DIRAC/Resources/Catalog/TSCatalogClient.py similarity index 100% rename from Resources/Catalog/TSCatalogClient.py rename to src/DIRAC/Resources/Catalog/TSCatalogClient.py diff --git a/Resources/Catalog/Utilities.py b/src/DIRAC/Resources/Catalog/Utilities.py similarity index 100% rename from Resources/Catalog/Utilities.py rename to src/DIRAC/Resources/Catalog/Utilities.py diff --git a/Resources/Catalog/__init__.py b/src/DIRAC/Resources/Catalog/__init__.py similarity index 100% rename from Resources/Catalog/__init__.py rename to src/DIRAC/Resources/Catalog/__init__.py diff --git a/Resources/Catalog/test/Test_FCConditionParser.py b/src/DIRAC/Resources/Catalog/test/Test_FCConditionParser.py similarity index 100% rename from Resources/Catalog/test/Test_FCConditionParser.py rename to src/DIRAC/Resources/Catalog/test/Test_FCConditionParser.py diff --git a/Resources/Catalog/test/Test_FileCatalog.py b/src/DIRAC/Resources/Catalog/test/Test_FileCatalog.py similarity index 100% rename from Resources/Catalog/test/Test_FileCatalog.py rename to src/DIRAC/Resources/Catalog/test/Test_FileCatalog.py diff --git a/Resources/Catalog/test/__init__.py b/src/DIRAC/Resources/Catalog/test/__init__.py similarity index 100% rename from Resources/Catalog/test/__init__.py rename to src/DIRAC/Resources/Catalog/test/__init__.py diff --git a/Resources/Catalog/test/mock_FC.py b/src/DIRAC/Resources/Catalog/test/mock_FC.py similarity index 100% rename from Resources/Catalog/test/mock_FC.py rename to src/DIRAC/Resources/Catalog/test/mock_FC.py diff --git a/Resources/Computing/ARCComputingElement.py b/src/DIRAC/Resources/Computing/ARCComputingElement.py similarity index 100% rename from Resources/Computing/ARCComputingElement.py rename to src/DIRAC/Resources/Computing/ARCComputingElement.py diff --git a/Resources/Computing/BOINCComputingElement.py b/src/DIRAC/Resources/Computing/BOINCComputingElement.py similarity index 100% rename from Resources/Computing/BOINCComputingElement.py rename to src/DIRAC/Resources/Computing/BOINCComputingElement.py diff --git a/Resources/Computing/BatchSystems/Condor.py b/src/DIRAC/Resources/Computing/BatchSystems/Condor.py similarity index 100% rename from Resources/Computing/BatchSystems/Condor.py rename to src/DIRAC/Resources/Computing/BatchSystems/Condor.py diff --git a/Resources/Computing/BatchSystems/GE.py b/src/DIRAC/Resources/Computing/BatchSystems/GE.py similarity index 100% rename from Resources/Computing/BatchSystems/GE.py rename to src/DIRAC/Resources/Computing/BatchSystems/GE.py diff --git a/Resources/Computing/BatchSystems/Host.py b/src/DIRAC/Resources/Computing/BatchSystems/Host.py similarity index 100% rename from Resources/Computing/BatchSystems/Host.py rename to src/DIRAC/Resources/Computing/BatchSystems/Host.py diff --git a/Resources/Computing/BatchSystems/LSF.py b/src/DIRAC/Resources/Computing/BatchSystems/LSF.py similarity index 100% rename from Resources/Computing/BatchSystems/LSF.py rename to src/DIRAC/Resources/Computing/BatchSystems/LSF.py diff --git a/Resources/Computing/BatchSystems/OAR.py b/src/DIRAC/Resources/Computing/BatchSystems/OAR.py similarity index 100% rename from Resources/Computing/BatchSystems/OAR.py rename to src/DIRAC/Resources/Computing/BatchSystems/OAR.py diff --git a/Resources/Computing/BatchSystems/SLURM.py b/src/DIRAC/Resources/Computing/BatchSystems/SLURM.py similarity index 100% rename from Resources/Computing/BatchSystems/SLURM.py rename to src/DIRAC/Resources/Computing/BatchSystems/SLURM.py diff --git a/Resources/Computing/BatchSystems/TimeLeft/LSFResourceUsage.py b/src/DIRAC/Resources/Computing/BatchSystems/TimeLeft/LSFResourceUsage.py similarity index 100% rename from Resources/Computing/BatchSystems/TimeLeft/LSFResourceUsage.py rename to src/DIRAC/Resources/Computing/BatchSystems/TimeLeft/LSFResourceUsage.py diff --git a/Resources/Computing/BatchSystems/TimeLeft/MJFResourceUsage.py b/src/DIRAC/Resources/Computing/BatchSystems/TimeLeft/MJFResourceUsage.py similarity index 100% rename from Resources/Computing/BatchSystems/TimeLeft/MJFResourceUsage.py rename to src/DIRAC/Resources/Computing/BatchSystems/TimeLeft/MJFResourceUsage.py diff --git a/Resources/Computing/BatchSystems/TimeLeft/PBSResourceUsage.py b/src/DIRAC/Resources/Computing/BatchSystems/TimeLeft/PBSResourceUsage.py similarity index 100% rename from Resources/Computing/BatchSystems/TimeLeft/PBSResourceUsage.py rename to src/DIRAC/Resources/Computing/BatchSystems/TimeLeft/PBSResourceUsage.py diff --git a/Resources/Computing/BatchSystems/TimeLeft/ResourceUsage.py b/src/DIRAC/Resources/Computing/BatchSystems/TimeLeft/ResourceUsage.py similarity index 100% rename from Resources/Computing/BatchSystems/TimeLeft/ResourceUsage.py rename to src/DIRAC/Resources/Computing/BatchSystems/TimeLeft/ResourceUsage.py diff --git a/Resources/Computing/BatchSystems/TimeLeft/SGEResourceUsage.py b/src/DIRAC/Resources/Computing/BatchSystems/TimeLeft/SGEResourceUsage.py similarity index 100% rename from Resources/Computing/BatchSystems/TimeLeft/SGEResourceUsage.py rename to src/DIRAC/Resources/Computing/BatchSystems/TimeLeft/SGEResourceUsage.py diff --git a/Resources/Computing/BatchSystems/TimeLeft/SLURMResourceUsage.py b/src/DIRAC/Resources/Computing/BatchSystems/TimeLeft/SLURMResourceUsage.py similarity index 100% rename from Resources/Computing/BatchSystems/TimeLeft/SLURMResourceUsage.py rename to src/DIRAC/Resources/Computing/BatchSystems/TimeLeft/SLURMResourceUsage.py diff --git a/Resources/Computing/BatchSystems/TimeLeft/TimeLeft.py b/src/DIRAC/Resources/Computing/BatchSystems/TimeLeft/TimeLeft.py similarity index 100% rename from Resources/Computing/BatchSystems/TimeLeft/TimeLeft.py rename to src/DIRAC/Resources/Computing/BatchSystems/TimeLeft/TimeLeft.py diff --git a/Resources/Computing/BatchSystems/TimeLeft/__init__.py b/src/DIRAC/Resources/Computing/BatchSystems/TimeLeft/__init__.py similarity index 100% rename from Resources/Computing/BatchSystems/TimeLeft/__init__.py rename to src/DIRAC/Resources/Computing/BatchSystems/TimeLeft/__init__.py diff --git a/Resources/Computing/BatchSystems/TimeLeft/test/Test_LSFResourceUsage.py b/src/DIRAC/Resources/Computing/BatchSystems/TimeLeft/test/Test_LSFResourceUsage.py similarity index 100% rename from Resources/Computing/BatchSystems/TimeLeft/test/Test_LSFResourceUsage.py rename to src/DIRAC/Resources/Computing/BatchSystems/TimeLeft/test/Test_LSFResourceUsage.py diff --git a/Resources/Computing/BatchSystems/TimeLeft/test/Test_TimeLeft.py b/src/DIRAC/Resources/Computing/BatchSystems/TimeLeft/test/Test_TimeLeft.py similarity index 100% rename from Resources/Computing/BatchSystems/TimeLeft/test/Test_TimeLeft.py rename to src/DIRAC/Resources/Computing/BatchSystems/TimeLeft/test/Test_TimeLeft.py diff --git a/Resources/Computing/BatchSystems/TimeLeft/test/__init__.py b/src/DIRAC/Resources/Computing/BatchSystems/TimeLeft/test/__init__.py similarity index 100% rename from Resources/Computing/BatchSystems/TimeLeft/test/__init__.py rename to src/DIRAC/Resources/Computing/BatchSystems/TimeLeft/test/__init__.py diff --git a/Resources/Computing/BatchSystems/Torque.py b/src/DIRAC/Resources/Computing/BatchSystems/Torque.py similarity index 100% rename from Resources/Computing/BatchSystems/Torque.py rename to src/DIRAC/Resources/Computing/BatchSystems/Torque.py diff --git a/Resources/Computing/BatchSystems/__init__.py b/src/DIRAC/Resources/Computing/BatchSystems/__init__.py similarity index 100% rename from Resources/Computing/BatchSystems/__init__.py rename to src/DIRAC/Resources/Computing/BatchSystems/__init__.py diff --git a/Resources/Computing/BatchSystems/executeBatch.py b/src/DIRAC/Resources/Computing/BatchSystems/executeBatch.py similarity index 100% rename from Resources/Computing/BatchSystems/executeBatch.py rename to src/DIRAC/Resources/Computing/BatchSystems/executeBatch.py diff --git a/Resources/Computing/CREAMComputingElement.py b/src/DIRAC/Resources/Computing/CREAMComputingElement.py similarity index 100% rename from Resources/Computing/CREAMComputingElement.py rename to src/DIRAC/Resources/Computing/CREAMComputingElement.py diff --git a/Resources/Computing/ComputingElement.py b/src/DIRAC/Resources/Computing/ComputingElement.py similarity index 100% rename from Resources/Computing/ComputingElement.py rename to src/DIRAC/Resources/Computing/ComputingElement.py diff --git a/Resources/Computing/ComputingElementFactory.py b/src/DIRAC/Resources/Computing/ComputingElementFactory.py similarity index 100% rename from Resources/Computing/ComputingElementFactory.py rename to src/DIRAC/Resources/Computing/ComputingElementFactory.py diff --git a/Resources/Computing/GlobusComputingElement.py b/src/DIRAC/Resources/Computing/GlobusComputingElement.py similarity index 100% rename from Resources/Computing/GlobusComputingElement.py rename to src/DIRAC/Resources/Computing/GlobusComputingElement.py diff --git a/Resources/Computing/HTCondorCEComputingElement.py b/src/DIRAC/Resources/Computing/HTCondorCEComputingElement.py similarity index 100% rename from Resources/Computing/HTCondorCEComputingElement.py rename to src/DIRAC/Resources/Computing/HTCondorCEComputingElement.py diff --git a/Resources/Computing/InProcessComputingElement.py b/src/DIRAC/Resources/Computing/InProcessComputingElement.py similarity index 100% rename from Resources/Computing/InProcessComputingElement.py rename to src/DIRAC/Resources/Computing/InProcessComputingElement.py diff --git a/Resources/Computing/LocalComputingElement.py b/src/DIRAC/Resources/Computing/LocalComputingElement.py similarity index 100% rename from Resources/Computing/LocalComputingElement.py rename to src/DIRAC/Resources/Computing/LocalComputingElement.py diff --git a/Resources/Computing/PilotBundle.py b/src/DIRAC/Resources/Computing/PilotBundle.py similarity index 100% rename from Resources/Computing/PilotBundle.py rename to src/DIRAC/Resources/Computing/PilotBundle.py diff --git a/Resources/Computing/PoolComputingElement.py b/src/DIRAC/Resources/Computing/PoolComputingElement.py similarity index 100% rename from Resources/Computing/PoolComputingElement.py rename to src/DIRAC/Resources/Computing/PoolComputingElement.py diff --git a/Resources/Computing/SSHBatchComputingElement.py b/src/DIRAC/Resources/Computing/SSHBatchComputingElement.py similarity index 100% rename from Resources/Computing/SSHBatchComputingElement.py rename to src/DIRAC/Resources/Computing/SSHBatchComputingElement.py diff --git a/Resources/Computing/SSHComputingElement.py b/src/DIRAC/Resources/Computing/SSHComputingElement.py similarity index 100% rename from Resources/Computing/SSHComputingElement.py rename to src/DIRAC/Resources/Computing/SSHComputingElement.py diff --git a/Resources/Computing/SingularityComputingElement.py b/src/DIRAC/Resources/Computing/SingularityComputingElement.py similarity index 100% rename from Resources/Computing/SingularityComputingElement.py rename to src/DIRAC/Resources/Computing/SingularityComputingElement.py diff --git a/Resources/Computing/SudoComputingElement.py b/src/DIRAC/Resources/Computing/SudoComputingElement.py similarity index 100% rename from Resources/Computing/SudoComputingElement.py rename to src/DIRAC/Resources/Computing/SudoComputingElement.py diff --git a/Resources/Computing/__init__.py b/src/DIRAC/Resources/Computing/__init__.py similarity index 100% rename from Resources/Computing/__init__.py rename to src/DIRAC/Resources/Computing/__init__.py diff --git a/Resources/Computing/glexecComputingElement.py b/src/DIRAC/Resources/Computing/glexecComputingElement.py similarity index 100% rename from Resources/Computing/glexecComputingElement.py rename to src/DIRAC/Resources/Computing/glexecComputingElement.py diff --git a/Resources/Computing/test/Test_HTCondorCEComputingElement.py b/src/DIRAC/Resources/Computing/test/Test_HTCondorCEComputingElement.py similarity index 100% rename from Resources/Computing/test/Test_HTCondorCEComputingElement.py rename to src/DIRAC/Resources/Computing/test/Test_HTCondorCEComputingElement.py diff --git a/Resources/Computing/test/Test_InProcessComputingElement.py b/src/DIRAC/Resources/Computing/test/Test_InProcessComputingElement.py similarity index 100% rename from Resources/Computing/test/Test_InProcessComputingElement.py rename to src/DIRAC/Resources/Computing/test/Test_InProcessComputingElement.py diff --git a/Resources/Computing/test/Test_PoolComputingElement.py b/src/DIRAC/Resources/Computing/test/Test_PoolComputingElement.py similarity index 100% rename from Resources/Computing/test/Test_PoolComputingElement.py rename to src/DIRAC/Resources/Computing/test/Test_PoolComputingElement.py diff --git a/Resources/Computing/test/Test_SSHComputingElement.py b/src/DIRAC/Resources/Computing/test/Test_SSHComputingElement.py similarity index 100% rename from Resources/Computing/test/Test_SSHComputingElement.py rename to src/DIRAC/Resources/Computing/test/Test_SSHComputingElement.py diff --git a/Resources/Computing/test/__init__.py b/src/DIRAC/Resources/Computing/test/__init__.py similarity index 100% rename from Resources/Computing/test/__init__.py rename to src/DIRAC/Resources/Computing/test/__init__.py diff --git a/Resources/IdProvider/IdProvider.py b/src/DIRAC/Resources/IdProvider/IdProvider.py similarity index 100% rename from Resources/IdProvider/IdProvider.py rename to src/DIRAC/Resources/IdProvider/IdProvider.py diff --git a/Resources/IdProvider/IdProviderFactory.py b/src/DIRAC/Resources/IdProvider/IdProviderFactory.py similarity index 100% rename from Resources/IdProvider/IdProviderFactory.py rename to src/DIRAC/Resources/IdProvider/IdProviderFactory.py diff --git a/Resources/IdProvider/__init__.py b/src/DIRAC/Resources/IdProvider/__init__.py similarity index 100% rename from Resources/IdProvider/__init__.py rename to src/DIRAC/Resources/IdProvider/__init__.py diff --git a/Resources/LogBackends/AbstractBackend.py b/src/DIRAC/Resources/LogBackends/AbstractBackend.py similarity index 100% rename from Resources/LogBackends/AbstractBackend.py rename to src/DIRAC/Resources/LogBackends/AbstractBackend.py diff --git a/Resources/LogBackends/ElasticSearchBackend.py b/src/DIRAC/Resources/LogBackends/ElasticSearchBackend.py similarity index 100% rename from Resources/LogBackends/ElasticSearchBackend.py rename to src/DIRAC/Resources/LogBackends/ElasticSearchBackend.py diff --git a/Resources/LogBackends/FileBackend.py b/src/DIRAC/Resources/LogBackends/FileBackend.py similarity index 100% rename from Resources/LogBackends/FileBackend.py rename to src/DIRAC/Resources/LogBackends/FileBackend.py diff --git a/Resources/LogBackends/MessageQueueBackend.py b/src/DIRAC/Resources/LogBackends/MessageQueueBackend.py similarity index 100% rename from Resources/LogBackends/MessageQueueBackend.py rename to src/DIRAC/Resources/LogBackends/MessageQueueBackend.py diff --git a/Resources/LogBackends/ServerBackend.py b/src/DIRAC/Resources/LogBackends/ServerBackend.py similarity index 100% rename from Resources/LogBackends/ServerBackend.py rename to src/DIRAC/Resources/LogBackends/ServerBackend.py diff --git a/Resources/LogBackends/StderrBackend.py b/src/DIRAC/Resources/LogBackends/StderrBackend.py similarity index 100% rename from Resources/LogBackends/StderrBackend.py rename to src/DIRAC/Resources/LogBackends/StderrBackend.py diff --git a/Resources/LogBackends/StdoutBackend.py b/src/DIRAC/Resources/LogBackends/StdoutBackend.py similarity index 100% rename from Resources/LogBackends/StdoutBackend.py rename to src/DIRAC/Resources/LogBackends/StdoutBackend.py diff --git a/Resources/LogBackends/__init__.py b/src/DIRAC/Resources/LogBackends/__init__.py similarity index 100% rename from Resources/LogBackends/__init__.py rename to src/DIRAC/Resources/LogBackends/__init__.py diff --git a/Resources/LogFilters/ModuleFilter.py b/src/DIRAC/Resources/LogFilters/ModuleFilter.py similarity index 100% rename from Resources/LogFilters/ModuleFilter.py rename to src/DIRAC/Resources/LogFilters/ModuleFilter.py diff --git a/Resources/LogFilters/PatternFilter.py b/src/DIRAC/Resources/LogFilters/PatternFilter.py similarity index 100% rename from Resources/LogFilters/PatternFilter.py rename to src/DIRAC/Resources/LogFilters/PatternFilter.py diff --git a/Resources/LogFilters/__init__.py b/src/DIRAC/Resources/LogFilters/__init__.py similarity index 100% rename from Resources/LogFilters/__init__.py rename to src/DIRAC/Resources/LogFilters/__init__.py diff --git a/Resources/LogFilters/test/Test_PatternFilter.py b/src/DIRAC/Resources/LogFilters/test/Test_PatternFilter.py similarity index 100% rename from Resources/LogFilters/test/Test_PatternFilter.py rename to src/DIRAC/Resources/LogFilters/test/Test_PatternFilter.py diff --git a/Resources/MessageQueue/MQCommunication.py b/src/DIRAC/Resources/MessageQueue/MQCommunication.py similarity index 100% rename from Resources/MessageQueue/MQCommunication.py rename to src/DIRAC/Resources/MessageQueue/MQCommunication.py diff --git a/Resources/MessageQueue/MQConnectionManager.py b/src/DIRAC/Resources/MessageQueue/MQConnectionManager.py similarity index 100% rename from Resources/MessageQueue/MQConnectionManager.py rename to src/DIRAC/Resources/MessageQueue/MQConnectionManager.py diff --git a/Resources/MessageQueue/MQConnector.py b/src/DIRAC/Resources/MessageQueue/MQConnector.py similarity index 100% rename from Resources/MessageQueue/MQConnector.py rename to src/DIRAC/Resources/MessageQueue/MQConnector.py diff --git a/Resources/MessageQueue/MQConsumer.py b/src/DIRAC/Resources/MessageQueue/MQConsumer.py similarity index 100% rename from Resources/MessageQueue/MQConsumer.py rename to src/DIRAC/Resources/MessageQueue/MQConsumer.py diff --git a/Resources/MessageQueue/MQProducer.py b/src/DIRAC/Resources/MessageQueue/MQProducer.py similarity index 100% rename from Resources/MessageQueue/MQProducer.py rename to src/DIRAC/Resources/MessageQueue/MQProducer.py diff --git a/Resources/MessageQueue/StompMQConnector.py b/src/DIRAC/Resources/MessageQueue/StompMQConnector.py similarity index 100% rename from Resources/MessageQueue/StompMQConnector.py rename to src/DIRAC/Resources/MessageQueue/StompMQConnector.py diff --git a/Resources/MessageQueue/Utilities.py b/src/DIRAC/Resources/MessageQueue/Utilities.py similarity index 100% rename from Resources/MessageQueue/Utilities.py rename to src/DIRAC/Resources/MessageQueue/Utilities.py diff --git a/Resources/MessageQueue/__init__.py b/src/DIRAC/Resources/MessageQueue/__init__.py similarity index 100% rename from Resources/MessageQueue/__init__.py rename to src/DIRAC/Resources/MessageQueue/__init__.py diff --git a/Resources/MessageQueue/test/Test_MQConnectionManager.py b/src/DIRAC/Resources/MessageQueue/test/Test_MQConnectionManager.py similarity index 100% rename from Resources/MessageQueue/test/Test_MQConnectionManager.py rename to src/DIRAC/Resources/MessageQueue/test/Test_MQConnectionManager.py diff --git a/Resources/MessageQueue/test/Test_MQConsumer.py b/src/DIRAC/Resources/MessageQueue/test/Test_MQConsumer.py similarity index 100% rename from Resources/MessageQueue/test/Test_MQConsumer.py rename to src/DIRAC/Resources/MessageQueue/test/Test_MQConsumer.py diff --git a/Resources/MessageQueue/test/Test_MQProducer.py b/src/DIRAC/Resources/MessageQueue/test/Test_MQProducer.py similarity index 100% rename from Resources/MessageQueue/test/Test_MQProducer.py rename to src/DIRAC/Resources/MessageQueue/test/Test_MQProducer.py diff --git a/Resources/MessageQueue/test/Test_MQ_Utilities.py b/src/DIRAC/Resources/MessageQueue/test/Test_MQ_Utilities.py similarity index 100% rename from Resources/MessageQueue/test/Test_MQ_Utilities.py rename to src/DIRAC/Resources/MessageQueue/test/Test_MQ_Utilities.py diff --git a/Resources/MessageQueue/test/Test_StompMQConnection.py b/src/DIRAC/Resources/MessageQueue/test/Test_StompMQConnection.py similarity index 100% rename from Resources/MessageQueue/test/Test_StompMQConnection.py rename to src/DIRAC/Resources/MessageQueue/test/Test_StompMQConnection.py diff --git a/Resources/ProxyProvider/DIRACCAProxyProvider.py b/src/DIRAC/Resources/ProxyProvider/DIRACCAProxyProvider.py similarity index 100% rename from Resources/ProxyProvider/DIRACCAProxyProvider.py rename to src/DIRAC/Resources/ProxyProvider/DIRACCAProxyProvider.py diff --git a/Resources/ProxyProvider/PUSPProxyProvider.py b/src/DIRAC/Resources/ProxyProvider/PUSPProxyProvider.py similarity index 100% rename from Resources/ProxyProvider/PUSPProxyProvider.py rename to src/DIRAC/Resources/ProxyProvider/PUSPProxyProvider.py diff --git a/Resources/ProxyProvider/ProxyProvider.py b/src/DIRAC/Resources/ProxyProvider/ProxyProvider.py similarity index 100% rename from Resources/ProxyProvider/ProxyProvider.py rename to src/DIRAC/Resources/ProxyProvider/ProxyProvider.py diff --git a/Resources/ProxyProvider/ProxyProviderFactory.py b/src/DIRAC/Resources/ProxyProvider/ProxyProviderFactory.py similarity index 100% rename from Resources/ProxyProvider/ProxyProviderFactory.py rename to src/DIRAC/Resources/ProxyProvider/ProxyProviderFactory.py diff --git a/Resources/ProxyProvider/__init__.py b/src/DIRAC/Resources/ProxyProvider/__init__.py similarity index 100% rename from Resources/ProxyProvider/__init__.py rename to src/DIRAC/Resources/ProxyProvider/__init__.py diff --git a/Resources/ProxyProvider/test/Test_DIRACCAProxyProvider.py b/src/DIRAC/Resources/ProxyProvider/test/Test_DIRACCAProxyProvider.py similarity index 97% rename from Resources/ProxyProvider/test/Test_DIRACCAProxyProvider.py rename to src/DIRAC/Resources/ProxyProvider/test/Test_DIRACCAProxyProvider.py index bdd772ad336..21bf75e365a 100644 --- a/Resources/ProxyProvider/test/Test_DIRACCAProxyProvider.py +++ b/src/DIRAC/Resources/ProxyProvider/test/Test_DIRACCAProxyProvider.py @@ -18,14 +18,12 @@ import unittest import tempfile -from DIRAC import gLogger +from DIRAC import gLogger, rootPath from DIRAC.Core.Security.X509Chain import X509Chain # pylint: disable=import-error from DIRAC.Resources.ProxyProvider.DIRACCAProxyProvider import DIRACCAProxyProvider -thisPath = os.path.dirname(os.path.abspath(__file__)).split('/') -rootPath = thisPath[:len(thisPath) - 3] -certsPath = os.path.join('/'.join(rootPath), 'Core/Security/test/certs') +certsPath = os.path.join(rootPath, 'DIRAC/Core/Security/test/certs') testCAPath = os.path.join(tempfile.mkdtemp(dir='/tmp'), 'ca') testCAConfigFile = os.path.join(testCAPath, 'openssl_config_ca.cnf') diff --git a/Resources/ProxyProvider/test/Test_ProxyProviderFactory.py b/src/DIRAC/Resources/ProxyProvider/test/Test_ProxyProviderFactory.py similarity index 100% rename from Resources/ProxyProvider/test/Test_ProxyProviderFactory.py rename to src/DIRAC/Resources/ProxyProvider/test/Test_ProxyProviderFactory.py diff --git a/Resources/ProxyProvider/test/__init__.py b/src/DIRAC/Resources/ProxyProvider/test/__init__.py similarity index 100% rename from Resources/ProxyProvider/test/__init__.py rename to src/DIRAC/Resources/ProxyProvider/test/__init__.py diff --git a/Resources/Storage/CTAStorage.py b/src/DIRAC/Resources/Storage/CTAStorage.py similarity index 100% rename from Resources/Storage/CTAStorage.py rename to src/DIRAC/Resources/Storage/CTAStorage.py diff --git a/Resources/Storage/DIPStorage.py b/src/DIRAC/Resources/Storage/DIPStorage.py similarity index 100% rename from Resources/Storage/DIPStorage.py rename to src/DIRAC/Resources/Storage/DIPStorage.py diff --git a/Resources/Storage/EchoStorage.py b/src/DIRAC/Resources/Storage/EchoStorage.py similarity index 100% rename from Resources/Storage/EchoStorage.py rename to src/DIRAC/Resources/Storage/EchoStorage.py diff --git a/Resources/Storage/FCOnlyStorage.py b/src/DIRAC/Resources/Storage/FCOnlyStorage.py similarity index 100% rename from Resources/Storage/FCOnlyStorage.py rename to src/DIRAC/Resources/Storage/FCOnlyStorage.py diff --git a/Resources/Storage/FileStorage.py b/src/DIRAC/Resources/Storage/FileStorage.py similarity index 100% rename from Resources/Storage/FileStorage.py rename to src/DIRAC/Resources/Storage/FileStorage.py diff --git a/Resources/Storage/GFAL2_GSIFTPStorage.py b/src/DIRAC/Resources/Storage/GFAL2_GSIFTPStorage.py similarity index 100% rename from Resources/Storage/GFAL2_GSIFTPStorage.py rename to src/DIRAC/Resources/Storage/GFAL2_GSIFTPStorage.py diff --git a/Resources/Storage/GFAL2_HTTPSStorage.py b/src/DIRAC/Resources/Storage/GFAL2_HTTPSStorage.py similarity index 100% rename from Resources/Storage/GFAL2_HTTPSStorage.py rename to src/DIRAC/Resources/Storage/GFAL2_HTTPSStorage.py diff --git a/Resources/Storage/GFAL2_SRM2Storage.py b/src/DIRAC/Resources/Storage/GFAL2_SRM2Storage.py similarity index 100% rename from Resources/Storage/GFAL2_SRM2Storage.py rename to src/DIRAC/Resources/Storage/GFAL2_SRM2Storage.py diff --git a/Resources/Storage/GFAL2_StorageBase.py b/src/DIRAC/Resources/Storage/GFAL2_StorageBase.py similarity index 100% rename from Resources/Storage/GFAL2_StorageBase.py rename to src/DIRAC/Resources/Storage/GFAL2_StorageBase.py diff --git a/Resources/Storage/GFAL2_XROOTStorage.py b/src/DIRAC/Resources/Storage/GFAL2_XROOTStorage.py similarity index 100% rename from Resources/Storage/GFAL2_XROOTStorage.py rename to src/DIRAC/Resources/Storage/GFAL2_XROOTStorage.py diff --git a/Resources/Storage/OccupancyPlugins/BDIIOccupancy.py b/src/DIRAC/Resources/Storage/OccupancyPlugins/BDIIOccupancy.py similarity index 100% rename from Resources/Storage/OccupancyPlugins/BDIIOccupancy.py rename to src/DIRAC/Resources/Storage/OccupancyPlugins/BDIIOccupancy.py diff --git a/Resources/Storage/OccupancyPlugins/WLCGAccountingHTTPJson.py b/src/DIRAC/Resources/Storage/OccupancyPlugins/WLCGAccountingHTTPJson.py similarity index 100% rename from Resources/Storage/OccupancyPlugins/WLCGAccountingHTTPJson.py rename to src/DIRAC/Resources/Storage/OccupancyPlugins/WLCGAccountingHTTPJson.py diff --git a/Resources/Storage/OccupancyPlugins/WLCGAccountingJson.py b/src/DIRAC/Resources/Storage/OccupancyPlugins/WLCGAccountingJson.py similarity index 100% rename from Resources/Storage/OccupancyPlugins/WLCGAccountingJson.py rename to src/DIRAC/Resources/Storage/OccupancyPlugins/WLCGAccountingJson.py diff --git a/Resources/Storage/OccupancyPlugins/__init__.py b/src/DIRAC/Resources/Storage/OccupancyPlugins/__init__.py similarity index 100% rename from Resources/Storage/OccupancyPlugins/__init__.py rename to src/DIRAC/Resources/Storage/OccupancyPlugins/__init__.py diff --git a/Resources/Storage/ProxyStorage.py b/src/DIRAC/Resources/Storage/ProxyStorage.py similarity index 100% rename from Resources/Storage/ProxyStorage.py rename to src/DIRAC/Resources/Storage/ProxyStorage.py diff --git a/Resources/Storage/RFIOStorage.py b/src/DIRAC/Resources/Storage/RFIOStorage.py similarity index 100% rename from Resources/Storage/RFIOStorage.py rename to src/DIRAC/Resources/Storage/RFIOStorage.py diff --git a/Resources/Storage/S3Storage.py b/src/DIRAC/Resources/Storage/S3Storage.py similarity index 100% rename from Resources/Storage/S3Storage.py rename to src/DIRAC/Resources/Storage/S3Storage.py diff --git a/Resources/Storage/StorageBase.py b/src/DIRAC/Resources/Storage/StorageBase.py similarity index 100% rename from Resources/Storage/StorageBase.py rename to src/DIRAC/Resources/Storage/StorageBase.py diff --git a/Resources/Storage/StorageElement.py b/src/DIRAC/Resources/Storage/StorageElement.py similarity index 100% rename from Resources/Storage/StorageElement.py rename to src/DIRAC/Resources/Storage/StorageElement.py diff --git a/Resources/Storage/StorageFactory.py b/src/DIRAC/Resources/Storage/StorageFactory.py similarity index 100% rename from Resources/Storage/StorageFactory.py rename to src/DIRAC/Resources/Storage/StorageFactory.py diff --git a/Resources/Storage/Utilities.py b/src/DIRAC/Resources/Storage/Utilities.py similarity index 100% rename from Resources/Storage/Utilities.py rename to src/DIRAC/Resources/Storage/Utilities.py diff --git a/Resources/Storage/__init__.py b/src/DIRAC/Resources/Storage/__init__.py similarity index 100% rename from Resources/Storage/__init__.py rename to src/DIRAC/Resources/Storage/__init__.py diff --git a/Resources/Storage/test/FIXME_Test_RFIOPlugIn.py b/src/DIRAC/Resources/Storage/test/FIXME_Test_RFIOPlugIn.py similarity index 100% rename from Resources/Storage/test/FIXME_Test_RFIOPlugIn.py rename to src/DIRAC/Resources/Storage/test/FIXME_Test_RFIOPlugIn.py diff --git a/Resources/Storage/test/FIXME_Test_StorageElement.py b/src/DIRAC/Resources/Storage/test/FIXME_Test_StorageElement.py similarity index 100% rename from Resources/Storage/test/FIXME_Test_StorageElement.py rename to src/DIRAC/Resources/Storage/test/FIXME_Test_StorageElement.py diff --git a/Resources/Storage/test/FIXME_Test_StoragePlugIn.py b/src/DIRAC/Resources/Storage/test/FIXME_Test_StoragePlugIn.py similarity index 100% rename from Resources/Storage/test/FIXME_Test_StoragePlugIn.py rename to src/DIRAC/Resources/Storage/test/FIXME_Test_StoragePlugIn.py diff --git a/Resources/Storage/test/Test_FilePlugin.py b/src/DIRAC/Resources/Storage/test/Test_FilePlugin.py similarity index 100% rename from Resources/Storage/test/Test_FilePlugin.py rename to src/DIRAC/Resources/Storage/test/Test_FilePlugin.py diff --git a/Resources/Storage/test/Test_GFAL2_XROOTStorage.py b/src/DIRAC/Resources/Storage/test/Test_GFAL2_XROOTStorage.py similarity index 100% rename from Resources/Storage/test/Test_GFAL2_XROOTStorage.py rename to src/DIRAC/Resources/Storage/test/Test_GFAL2_XROOTStorage.py diff --git a/Resources/Storage/test/Test_StorageElement.py b/src/DIRAC/Resources/Storage/test/Test_StorageElement.py similarity index 100% rename from Resources/Storage/test/Test_StorageElement.py rename to src/DIRAC/Resources/Storage/test/Test_StorageElement.py diff --git a/Resources/Storage/test/Test_StorageFactory.py b/src/DIRAC/Resources/Storage/test/Test_StorageFactory.py similarity index 100% rename from Resources/Storage/test/Test_StorageFactory.py rename to src/DIRAC/Resources/Storage/test/Test_StorageFactory.py diff --git a/Resources/Storage/test/__init__.py b/src/DIRAC/Resources/Storage/test/__init__.py similarity index 100% rename from Resources/Storage/test/__init__.py rename to src/DIRAC/Resources/Storage/test/__init__.py diff --git a/Resources/__init__.py b/src/DIRAC/Resources/__init__.py similarity index 100% rename from Resources/__init__.py rename to src/DIRAC/Resources/__init__.py diff --git a/Resources/scripts/dirac-resource-get-parameters.py b/src/DIRAC/Resources/scripts/dirac-resource-get-parameters.py similarity index 100% rename from Resources/scripts/dirac-resource-get-parameters.py rename to src/DIRAC/Resources/scripts/dirac-resource-get-parameters.py diff --git a/Resources/scripts/dirac-resource-info.py b/src/DIRAC/Resources/scripts/dirac-resource-info.py similarity index 100% rename from Resources/scripts/dirac-resource-info.py rename to src/DIRAC/Resources/scripts/dirac-resource-info.py diff --git a/StorageManagementSystem/Agent/RequestFinalizationAgent.py b/src/DIRAC/StorageManagementSystem/Agent/RequestFinalizationAgent.py similarity index 100% rename from StorageManagementSystem/Agent/RequestFinalizationAgent.py rename to src/DIRAC/StorageManagementSystem/Agent/RequestFinalizationAgent.py diff --git a/StorageManagementSystem/Agent/RequestPreparationAgent.py b/src/DIRAC/StorageManagementSystem/Agent/RequestPreparationAgent.py similarity index 100% rename from StorageManagementSystem/Agent/RequestPreparationAgent.py rename to src/DIRAC/StorageManagementSystem/Agent/RequestPreparationAgent.py diff --git a/StorageManagementSystem/Agent/StageMonitorAgent.py b/src/DIRAC/StorageManagementSystem/Agent/StageMonitorAgent.py similarity index 100% rename from StorageManagementSystem/Agent/StageMonitorAgent.py rename to src/DIRAC/StorageManagementSystem/Agent/StageMonitorAgent.py diff --git a/StorageManagementSystem/Agent/StageRequestAgent.py b/src/DIRAC/StorageManagementSystem/Agent/StageRequestAgent.py similarity index 100% rename from StorageManagementSystem/Agent/StageRequestAgent.py rename to src/DIRAC/StorageManagementSystem/Agent/StageRequestAgent.py diff --git a/StorageManagementSystem/Agent/__init__.py b/src/DIRAC/StorageManagementSystem/Agent/__init__.py similarity index 100% rename from StorageManagementSystem/Agent/__init__.py rename to src/DIRAC/StorageManagementSystem/Agent/__init__.py diff --git a/StorageManagementSystem/Client/StorageManagerClient.py b/src/DIRAC/StorageManagementSystem/Client/StorageManagerClient.py similarity index 100% rename from StorageManagementSystem/Client/StorageManagerClient.py rename to src/DIRAC/StorageManagementSystem/Client/StorageManagerClient.py diff --git a/StorageManagementSystem/Client/__init__.py b/src/DIRAC/StorageManagementSystem/Client/__init__.py similarity index 100% rename from StorageManagementSystem/Client/__init__.py rename to src/DIRAC/StorageManagementSystem/Client/__init__.py diff --git a/StorageManagementSystem/Client/test/Test_Client_StorageManagementSystem.py b/src/DIRAC/StorageManagementSystem/Client/test/Test_Client_StorageManagementSystem.py similarity index 100% rename from StorageManagementSystem/Client/test/Test_Client_StorageManagementSystem.py rename to src/DIRAC/StorageManagementSystem/Client/test/Test_Client_StorageManagementSystem.py diff --git a/StorageManagementSystem/ConfigTemplate.cfg b/src/DIRAC/StorageManagementSystem/ConfigTemplate.cfg similarity index 100% rename from StorageManagementSystem/ConfigTemplate.cfg rename to src/DIRAC/StorageManagementSystem/ConfigTemplate.cfg diff --git a/StorageManagementSystem/DB/StorageManagementDB.py b/src/DIRAC/StorageManagementSystem/DB/StorageManagementDB.py similarity index 100% rename from StorageManagementSystem/DB/StorageManagementDB.py rename to src/DIRAC/StorageManagementSystem/DB/StorageManagementDB.py diff --git a/StorageManagementSystem/DB/StorageManagementDB.sql b/src/DIRAC/StorageManagementSystem/DB/StorageManagementDB.sql similarity index 100% rename from StorageManagementSystem/DB/StorageManagementDB.sql rename to src/DIRAC/StorageManagementSystem/DB/StorageManagementDB.sql diff --git a/StorageManagementSystem/DB/__init__.py b/src/DIRAC/StorageManagementSystem/DB/__init__.py similarity index 100% rename from StorageManagementSystem/DB/__init__.py rename to src/DIRAC/StorageManagementSystem/DB/__init__.py diff --git a/StorageManagementSystem/Service/StorageManagerHandler.py b/src/DIRAC/StorageManagementSystem/Service/StorageManagerHandler.py similarity index 100% rename from StorageManagementSystem/Service/StorageManagerHandler.py rename to src/DIRAC/StorageManagementSystem/Service/StorageManagerHandler.py diff --git a/StorageManagementSystem/Service/__init__.py b/src/DIRAC/StorageManagementSystem/Service/__init__.py similarity index 100% rename from StorageManagementSystem/Service/__init__.py rename to src/DIRAC/StorageManagementSystem/Service/__init__.py diff --git a/StorageManagementSystem/__init__.py b/src/DIRAC/StorageManagementSystem/__init__.py similarity index 100% rename from StorageManagementSystem/__init__.py rename to src/DIRAC/StorageManagementSystem/__init__.py diff --git a/StorageManagementSystem/scripts/__init__.py b/src/DIRAC/StorageManagementSystem/scripts/__init__.py similarity index 100% rename from StorageManagementSystem/scripts/__init__.py rename to src/DIRAC/StorageManagementSystem/scripts/__init__.py diff --git a/StorageManagementSystem/scripts/dirac-stager-monitor-file.py b/src/DIRAC/StorageManagementSystem/scripts/dirac-stager-monitor-file.py similarity index 100% rename from StorageManagementSystem/scripts/dirac-stager-monitor-file.py rename to src/DIRAC/StorageManagementSystem/scripts/dirac-stager-monitor-file.py diff --git a/StorageManagementSystem/scripts/dirac-stager-monitor-jobs.py b/src/DIRAC/StorageManagementSystem/scripts/dirac-stager-monitor-jobs.py similarity index 100% rename from StorageManagementSystem/scripts/dirac-stager-monitor-jobs.py rename to src/DIRAC/StorageManagementSystem/scripts/dirac-stager-monitor-jobs.py diff --git a/StorageManagementSystem/scripts/dirac-stager-monitor-request.py b/src/DIRAC/StorageManagementSystem/scripts/dirac-stager-monitor-request.py similarity index 100% rename from StorageManagementSystem/scripts/dirac-stager-monitor-request.py rename to src/DIRAC/StorageManagementSystem/scripts/dirac-stager-monitor-request.py diff --git a/StorageManagementSystem/scripts/dirac-stager-monitor-requests.py b/src/DIRAC/StorageManagementSystem/scripts/dirac-stager-monitor-requests.py similarity index 100% rename from StorageManagementSystem/scripts/dirac-stager-monitor-requests.py rename to src/DIRAC/StorageManagementSystem/scripts/dirac-stager-monitor-requests.py diff --git a/StorageManagementSystem/scripts/dirac-stager-show-stats.py b/src/DIRAC/StorageManagementSystem/scripts/dirac-stager-show-stats.py similarity index 100% rename from StorageManagementSystem/scripts/dirac-stager-show-stats.py rename to src/DIRAC/StorageManagementSystem/scripts/dirac-stager-show-stats.py diff --git a/StorageManagementSystem/scripts/dirac-stager-stage-files.py b/src/DIRAC/StorageManagementSystem/scripts/dirac-stager-stage-files.py similarity index 100% rename from StorageManagementSystem/scripts/dirac-stager-stage-files.py rename to src/DIRAC/StorageManagementSystem/scripts/dirac-stager-stage-files.py diff --git a/TransformationSystem/Agent/DataRecoveryAgent.py b/src/DIRAC/TransformationSystem/Agent/DataRecoveryAgent.py similarity index 100% rename from TransformationSystem/Agent/DataRecoveryAgent.py rename to src/DIRAC/TransformationSystem/Agent/DataRecoveryAgent.py diff --git a/TransformationSystem/Agent/InputDataAgent.py b/src/DIRAC/TransformationSystem/Agent/InputDataAgent.py similarity index 100% rename from TransformationSystem/Agent/InputDataAgent.py rename to src/DIRAC/TransformationSystem/Agent/InputDataAgent.py diff --git a/TransformationSystem/Agent/MCExtensionAgent.py b/src/DIRAC/TransformationSystem/Agent/MCExtensionAgent.py similarity index 100% rename from TransformationSystem/Agent/MCExtensionAgent.py rename to src/DIRAC/TransformationSystem/Agent/MCExtensionAgent.py diff --git a/TransformationSystem/Agent/RequestOperations/SetFileStatus.py b/src/DIRAC/TransformationSystem/Agent/RequestOperations/SetFileStatus.py similarity index 100% rename from TransformationSystem/Agent/RequestOperations/SetFileStatus.py rename to src/DIRAC/TransformationSystem/Agent/RequestOperations/SetFileStatus.py diff --git a/TransformationSystem/Agent/RequestOperations/__init__.py b/src/DIRAC/TransformationSystem/Agent/RequestOperations/__init__.py similarity index 100% rename from TransformationSystem/Agent/RequestOperations/__init__.py rename to src/DIRAC/TransformationSystem/Agent/RequestOperations/__init__.py diff --git a/TransformationSystem/Agent/RequestTaskAgent.py b/src/DIRAC/TransformationSystem/Agent/RequestTaskAgent.py similarity index 100% rename from TransformationSystem/Agent/RequestTaskAgent.py rename to src/DIRAC/TransformationSystem/Agent/RequestTaskAgent.py diff --git a/TransformationSystem/Agent/TaskManagerAgentBase.py b/src/DIRAC/TransformationSystem/Agent/TaskManagerAgentBase.py similarity index 100% rename from TransformationSystem/Agent/TaskManagerAgentBase.py rename to src/DIRAC/TransformationSystem/Agent/TaskManagerAgentBase.py diff --git a/TransformationSystem/Agent/TransformationAgent.py b/src/DIRAC/TransformationSystem/Agent/TransformationAgent.py similarity index 100% rename from TransformationSystem/Agent/TransformationAgent.py rename to src/DIRAC/TransformationSystem/Agent/TransformationAgent.py diff --git a/TransformationSystem/Agent/TransformationAgentsUtilities.py b/src/DIRAC/TransformationSystem/Agent/TransformationAgentsUtilities.py similarity index 100% rename from TransformationSystem/Agent/TransformationAgentsUtilities.py rename to src/DIRAC/TransformationSystem/Agent/TransformationAgentsUtilities.py diff --git a/TransformationSystem/Agent/TransformationCleaningAgent.py b/src/DIRAC/TransformationSystem/Agent/TransformationCleaningAgent.py similarity index 100% rename from TransformationSystem/Agent/TransformationCleaningAgent.py rename to src/DIRAC/TransformationSystem/Agent/TransformationCleaningAgent.py diff --git a/TransformationSystem/Agent/TransformationPlugin.py b/src/DIRAC/TransformationSystem/Agent/TransformationPlugin.py similarity index 100% rename from TransformationSystem/Agent/TransformationPlugin.py rename to src/DIRAC/TransformationSystem/Agent/TransformationPlugin.py diff --git a/TransformationSystem/Agent/ValidateOutputDataAgent.py b/src/DIRAC/TransformationSystem/Agent/ValidateOutputDataAgent.py similarity index 100% rename from TransformationSystem/Agent/ValidateOutputDataAgent.py rename to src/DIRAC/TransformationSystem/Agent/ValidateOutputDataAgent.py diff --git a/TransformationSystem/Agent/WorkflowTaskAgent.py b/src/DIRAC/TransformationSystem/Agent/WorkflowTaskAgent.py similarity index 100% rename from TransformationSystem/Agent/WorkflowTaskAgent.py rename to src/DIRAC/TransformationSystem/Agent/WorkflowTaskAgent.py diff --git a/TransformationSystem/Agent/__init__.py b/src/DIRAC/TransformationSystem/Agent/__init__.py similarity index 100% rename from TransformationSystem/Agent/__init__.py rename to src/DIRAC/TransformationSystem/Agent/__init__.py diff --git a/TransformationSystem/Agent/test/Test_Agent_TransformationSystem.py b/src/DIRAC/TransformationSystem/Agent/test/Test_Agent_TransformationSystem.py similarity index 100% rename from TransformationSystem/Agent/test/Test_Agent_TransformationSystem.py rename to src/DIRAC/TransformationSystem/Agent/test/Test_Agent_TransformationSystem.py diff --git a/TransformationSystem/Agent/test/Test_Plugins.py b/src/DIRAC/TransformationSystem/Agent/test/Test_Plugins.py similarity index 100% rename from TransformationSystem/Agent/test/Test_Plugins.py rename to src/DIRAC/TransformationSystem/Agent/test/Test_Plugins.py diff --git a/TransformationSystem/Client/FileReport.py b/src/DIRAC/TransformationSystem/Client/FileReport.py similarity index 100% rename from TransformationSystem/Client/FileReport.py rename to src/DIRAC/TransformationSystem/Client/FileReport.py diff --git a/TransformationSystem/Client/PluginBase.py b/src/DIRAC/TransformationSystem/Client/PluginBase.py similarity index 100% rename from TransformationSystem/Client/PluginBase.py rename to src/DIRAC/TransformationSystem/Client/PluginBase.py diff --git a/TransformationSystem/Client/TaskManager.py b/src/DIRAC/TransformationSystem/Client/TaskManager.py similarity index 100% rename from TransformationSystem/Client/TaskManager.py rename to src/DIRAC/TransformationSystem/Client/TaskManager.py diff --git a/TransformationSystem/Client/TaskManagerPlugin.py b/src/DIRAC/TransformationSystem/Client/TaskManagerPlugin.py similarity index 100% rename from TransformationSystem/Client/TaskManagerPlugin.py rename to src/DIRAC/TransformationSystem/Client/TaskManagerPlugin.py diff --git a/TransformationSystem/Client/Transformation.py b/src/DIRAC/TransformationSystem/Client/Transformation.py similarity index 100% rename from TransformationSystem/Client/Transformation.py rename to src/DIRAC/TransformationSystem/Client/Transformation.py diff --git a/TransformationSystem/Client/TransformationCLI.py b/src/DIRAC/TransformationSystem/Client/TransformationCLI.py similarity index 100% rename from TransformationSystem/Client/TransformationCLI.py rename to src/DIRAC/TransformationSystem/Client/TransformationCLI.py diff --git a/TransformationSystem/Client/TransformationClient.py b/src/DIRAC/TransformationSystem/Client/TransformationClient.py similarity index 100% rename from TransformationSystem/Client/TransformationClient.py rename to src/DIRAC/TransformationSystem/Client/TransformationClient.py diff --git a/TransformationSystem/Client/Utilities.py b/src/DIRAC/TransformationSystem/Client/Utilities.py similarity index 100% rename from TransformationSystem/Client/Utilities.py rename to src/DIRAC/TransformationSystem/Client/Utilities.py diff --git a/TransformationSystem/Client/__init__.py b/src/DIRAC/TransformationSystem/Client/__init__.py similarity index 100% rename from TransformationSystem/Client/__init__.py rename to src/DIRAC/TransformationSystem/Client/__init__.py diff --git a/TransformationSystem/Client/test/Test_Client_TaskManagerPlugin.py b/src/DIRAC/TransformationSystem/Client/test/Test_Client_TaskManagerPlugin.py similarity index 100% rename from TransformationSystem/Client/test/Test_Client_TaskManagerPlugin.py rename to src/DIRAC/TransformationSystem/Client/test/Test_Client_TaskManagerPlugin.py diff --git a/TransformationSystem/Client/test/Test_Client_TransformationClient.py b/src/DIRAC/TransformationSystem/Client/test/Test_Client_TransformationClient.py similarity index 100% rename from TransformationSystem/Client/test/Test_Client_TransformationClient.py rename to src/DIRAC/TransformationSystem/Client/test/Test_Client_TransformationClient.py diff --git a/TransformationSystem/Client/test/Test_Client_TransformationSystem.py b/src/DIRAC/TransformationSystem/Client/test/Test_Client_TransformationSystem.py similarity index 100% rename from TransformationSystem/Client/test/Test_Client_TransformationSystem.py rename to src/DIRAC/TransformationSystem/Client/test/Test_Client_TransformationSystem.py diff --git a/TransformationSystem/Client/test/Test_Client_WorkflowTasks.py b/src/DIRAC/TransformationSystem/Client/test/Test_Client_WorkflowTasks.py similarity index 100% rename from TransformationSystem/Client/test/Test_Client_WorkflowTasks.py rename to src/DIRAC/TransformationSystem/Client/test/Test_Client_WorkflowTasks.py diff --git a/TransformationSystem/ConfigTemplate.cfg b/src/DIRAC/TransformationSystem/ConfigTemplate.cfg similarity index 100% rename from TransformationSystem/ConfigTemplate.cfg rename to src/DIRAC/TransformationSystem/ConfigTemplate.cfg diff --git a/TransformationSystem/DB/TransformationDB.py b/src/DIRAC/TransformationSystem/DB/TransformationDB.py similarity index 100% rename from TransformationSystem/DB/TransformationDB.py rename to src/DIRAC/TransformationSystem/DB/TransformationDB.py diff --git a/TransformationSystem/DB/TransformationDB.sql b/src/DIRAC/TransformationSystem/DB/TransformationDB.sql similarity index 100% rename from TransformationSystem/DB/TransformationDB.sql rename to src/DIRAC/TransformationSystem/DB/TransformationDB.sql diff --git a/TransformationSystem/DB/__init__.py b/src/DIRAC/TransformationSystem/DB/__init__.py similarity index 100% rename from TransformationSystem/DB/__init__.py rename to src/DIRAC/TransformationSystem/DB/__init__.py diff --git a/TransformationSystem/Service/TransformationManagerHandler.py b/src/DIRAC/TransformationSystem/Service/TransformationManagerHandler.py similarity index 100% rename from TransformationSystem/Service/TransformationManagerHandler.py rename to src/DIRAC/TransformationSystem/Service/TransformationManagerHandler.py diff --git a/TransformationSystem/Service/__init__.py b/src/DIRAC/TransformationSystem/Service/__init__.py similarity index 100% rename from TransformationSystem/Service/__init__.py rename to src/DIRAC/TransformationSystem/Service/__init__.py diff --git a/TransformationSystem/Utilities/JobInfo.py b/src/DIRAC/TransformationSystem/Utilities/JobInfo.py similarity index 100% rename from TransformationSystem/Utilities/JobInfo.py rename to src/DIRAC/TransformationSystem/Utilities/JobInfo.py diff --git a/TransformationSystem/Utilities/ReplicationCLIParameters.py b/src/DIRAC/TransformationSystem/Utilities/ReplicationCLIParameters.py similarity index 100% rename from TransformationSystem/Utilities/ReplicationCLIParameters.py rename to src/DIRAC/TransformationSystem/Utilities/ReplicationCLIParameters.py diff --git a/TransformationSystem/Utilities/ReplicationTransformation.py b/src/DIRAC/TransformationSystem/Utilities/ReplicationTransformation.py similarity index 100% rename from TransformationSystem/Utilities/ReplicationTransformation.py rename to src/DIRAC/TransformationSystem/Utilities/ReplicationTransformation.py diff --git a/TransformationSystem/Utilities/TransformationInfo.py b/src/DIRAC/TransformationSystem/Utilities/TransformationInfo.py similarity index 100% rename from TransformationSystem/Utilities/TransformationInfo.py rename to src/DIRAC/TransformationSystem/Utilities/TransformationInfo.py diff --git a/TransformationSystem/Utilities/__init__.py b/src/DIRAC/TransformationSystem/Utilities/__init__.py similarity index 100% rename from TransformationSystem/Utilities/__init__.py rename to src/DIRAC/TransformationSystem/Utilities/__init__.py diff --git a/TransformationSystem/__init__.py b/src/DIRAC/TransformationSystem/__init__.py similarity index 100% rename from TransformationSystem/__init__.py rename to src/DIRAC/TransformationSystem/__init__.py diff --git a/TransformationSystem/scripts/__init__.py b/src/DIRAC/TransformationSystem/scripts/__init__.py similarity index 100% rename from TransformationSystem/scripts/__init__.py rename to src/DIRAC/TransformationSystem/scripts/__init__.py diff --git a/TransformationSystem/scripts/dirac-production-runjoblocal.py b/src/DIRAC/TransformationSystem/scripts/dirac-production-runjoblocal.py similarity index 100% rename from TransformationSystem/scripts/dirac-production-runjoblocal.py rename to src/DIRAC/TransformationSystem/scripts/dirac-production-runjoblocal.py diff --git a/TransformationSystem/scripts/dirac-transformation-add-files.py b/src/DIRAC/TransformationSystem/scripts/dirac-transformation-add-files.py similarity index 100% rename from TransformationSystem/scripts/dirac-transformation-add-files.py rename to src/DIRAC/TransformationSystem/scripts/dirac-transformation-add-files.py diff --git a/TransformationSystem/scripts/dirac-transformation-archive.py b/src/DIRAC/TransformationSystem/scripts/dirac-transformation-archive.py similarity index 100% rename from TransformationSystem/scripts/dirac-transformation-archive.py rename to src/DIRAC/TransformationSystem/scripts/dirac-transformation-archive.py diff --git a/TransformationSystem/scripts/dirac-transformation-clean.py b/src/DIRAC/TransformationSystem/scripts/dirac-transformation-clean.py similarity index 100% rename from TransformationSystem/scripts/dirac-transformation-clean.py rename to src/DIRAC/TransformationSystem/scripts/dirac-transformation-clean.py diff --git a/TransformationSystem/scripts/dirac-transformation-cli.py b/src/DIRAC/TransformationSystem/scripts/dirac-transformation-cli.py similarity index 100% rename from TransformationSystem/scripts/dirac-transformation-cli.py rename to src/DIRAC/TransformationSystem/scripts/dirac-transformation-cli.py diff --git a/TransformationSystem/scripts/dirac-transformation-get-files.py b/src/DIRAC/TransformationSystem/scripts/dirac-transformation-get-files.py similarity index 100% rename from TransformationSystem/scripts/dirac-transformation-get-files.py rename to src/DIRAC/TransformationSystem/scripts/dirac-transformation-get-files.py diff --git a/TransformationSystem/scripts/dirac-transformation-recover-data.py b/src/DIRAC/TransformationSystem/scripts/dirac-transformation-recover-data.py similarity index 100% rename from TransformationSystem/scripts/dirac-transformation-recover-data.py rename to src/DIRAC/TransformationSystem/scripts/dirac-transformation-recover-data.py diff --git a/TransformationSystem/scripts/dirac-transformation-remove-output.py b/src/DIRAC/TransformationSystem/scripts/dirac-transformation-remove-output.py similarity index 100% rename from TransformationSystem/scripts/dirac-transformation-remove-output.py rename to src/DIRAC/TransformationSystem/scripts/dirac-transformation-remove-output.py diff --git a/TransformationSystem/scripts/dirac-transformation-replication.py b/src/DIRAC/TransformationSystem/scripts/dirac-transformation-replication.py similarity index 100% rename from TransformationSystem/scripts/dirac-transformation-replication.py rename to src/DIRAC/TransformationSystem/scripts/dirac-transformation-replication.py diff --git a/TransformationSystem/scripts/dirac-transformation-verify-outputdata.py b/src/DIRAC/TransformationSystem/scripts/dirac-transformation-verify-outputdata.py similarity index 100% rename from TransformationSystem/scripts/dirac-transformation-verify-outputdata.py rename to src/DIRAC/TransformationSystem/scripts/dirac-transformation-verify-outputdata.py diff --git a/TransformationSystem/test/Test_DRA.py b/src/DIRAC/TransformationSystem/test/Test_DRA.py similarity index 100% rename from TransformationSystem/test/Test_DRA.py rename to src/DIRAC/TransformationSystem/test/Test_DRA.py diff --git a/TransformationSystem/test/Test_JobInfo.py b/src/DIRAC/TransformationSystem/test/Test_JobInfo.py similarity index 100% rename from TransformationSystem/test/Test_JobInfo.py rename to src/DIRAC/TransformationSystem/test/Test_JobInfo.py diff --git a/TransformationSystem/test/Test_TransformationInfo.py b/src/DIRAC/TransformationSystem/test/Test_TransformationInfo.py similarity index 100% rename from TransformationSystem/test/Test_TransformationInfo.py rename to src/DIRAC/TransformationSystem/test/Test_TransformationInfo.py diff --git a/TransformationSystem/test/Test_replicationTransformation.py b/src/DIRAC/TransformationSystem/test/Test_replicationTransformation.py similarity index 100% rename from TransformationSystem/test/Test_replicationTransformation.py rename to src/DIRAC/TransformationSystem/test/Test_replicationTransformation.py diff --git a/TransformationSystem/test/__init__.py b/src/DIRAC/TransformationSystem/test/__init__.py similarity index 100% rename from TransformationSystem/test/__init__.py rename to src/DIRAC/TransformationSystem/test/__init__.py diff --git a/Workflow/Modules/FailoverRequest.py b/src/DIRAC/Workflow/Modules/FailoverRequest.py similarity index 100% rename from Workflow/Modules/FailoverRequest.py rename to src/DIRAC/Workflow/Modules/FailoverRequest.py diff --git a/Workflow/Modules/ModuleBase.py b/src/DIRAC/Workflow/Modules/ModuleBase.py similarity index 100% rename from Workflow/Modules/ModuleBase.py rename to src/DIRAC/Workflow/Modules/ModuleBase.py diff --git a/Workflow/Modules/Script.py b/src/DIRAC/Workflow/Modules/Script.py similarity index 100% rename from Workflow/Modules/Script.py rename to src/DIRAC/Workflow/Modules/Script.py diff --git a/Workflow/Modules/UploadOutputs.py b/src/DIRAC/Workflow/Modules/UploadOutputs.py similarity index 100% rename from Workflow/Modules/UploadOutputs.py rename to src/DIRAC/Workflow/Modules/UploadOutputs.py diff --git a/Workflow/Modules/__init__.py b/src/DIRAC/Workflow/Modules/__init__.py similarity index 100% rename from Workflow/Modules/__init__.py rename to src/DIRAC/Workflow/Modules/__init__.py diff --git a/Workflow/Modules/test/Test_Modules.py b/src/DIRAC/Workflow/Modules/test/Test_Modules.py similarity index 100% rename from Workflow/Modules/test/Test_Modules.py rename to src/DIRAC/Workflow/Modules/test/Test_Modules.py diff --git a/Workflow/Utilities/Utils.py b/src/DIRAC/Workflow/Utilities/Utils.py similarity index 100% rename from Workflow/Utilities/Utils.py rename to src/DIRAC/Workflow/Utilities/Utils.py diff --git a/Workflow/Utilities/__init__.py b/src/DIRAC/Workflow/Utilities/__init__.py similarity index 100% rename from Workflow/Utilities/__init__.py rename to src/DIRAC/Workflow/Utilities/__init__.py diff --git a/Workflow/Utilities/test/Test_Utilities.py b/src/DIRAC/Workflow/Utilities/test/Test_Utilities.py similarity index 100% rename from Workflow/Utilities/test/Test_Utilities.py rename to src/DIRAC/Workflow/Utilities/test/Test_Utilities.py diff --git a/Workflow/__init__.py b/src/DIRAC/Workflow/__init__.py similarity index 100% rename from Workflow/__init__.py rename to src/DIRAC/Workflow/__init__.py diff --git a/WorkloadManagementSystem/Agent/JobAgent.py b/src/DIRAC/WorkloadManagementSystem/Agent/JobAgent.py similarity index 100% rename from WorkloadManagementSystem/Agent/JobAgent.py rename to src/DIRAC/WorkloadManagementSystem/Agent/JobAgent.py diff --git a/WorkloadManagementSystem/Agent/JobCleaningAgent.py b/src/DIRAC/WorkloadManagementSystem/Agent/JobCleaningAgent.py similarity index 100% rename from WorkloadManagementSystem/Agent/JobCleaningAgent.py rename to src/DIRAC/WorkloadManagementSystem/Agent/JobCleaningAgent.py diff --git a/WorkloadManagementSystem/Agent/OptimizerModule.py b/src/DIRAC/WorkloadManagementSystem/Agent/OptimizerModule.py similarity index 100% rename from WorkloadManagementSystem/Agent/OptimizerModule.py rename to src/DIRAC/WorkloadManagementSystem/Agent/OptimizerModule.py diff --git a/WorkloadManagementSystem/Agent/PilotStatusAgent.py b/src/DIRAC/WorkloadManagementSystem/Agent/PilotStatusAgent.py similarity index 100% rename from WorkloadManagementSystem/Agent/PilotStatusAgent.py rename to src/DIRAC/WorkloadManagementSystem/Agent/PilotStatusAgent.py diff --git a/WorkloadManagementSystem/Agent/SiteDirector.py b/src/DIRAC/WorkloadManagementSystem/Agent/SiteDirector.py similarity index 100% rename from WorkloadManagementSystem/Agent/SiteDirector.py rename to src/DIRAC/WorkloadManagementSystem/Agent/SiteDirector.py diff --git a/WorkloadManagementSystem/Agent/StalledJobAgent.py b/src/DIRAC/WorkloadManagementSystem/Agent/StalledJobAgent.py similarity index 100% rename from WorkloadManagementSystem/Agent/StalledJobAgent.py rename to src/DIRAC/WorkloadManagementSystem/Agent/StalledJobAgent.py diff --git a/WorkloadManagementSystem/Agent/StatesAccountingAgent.py b/src/DIRAC/WorkloadManagementSystem/Agent/StatesAccountingAgent.py similarity index 100% rename from WorkloadManagementSystem/Agent/StatesAccountingAgent.py rename to src/DIRAC/WorkloadManagementSystem/Agent/StatesAccountingAgent.py diff --git a/WorkloadManagementSystem/Agent/StatesMonitoringAgent.py b/src/DIRAC/WorkloadManagementSystem/Agent/StatesMonitoringAgent.py similarity index 100% rename from WorkloadManagementSystem/Agent/StatesMonitoringAgent.py rename to src/DIRAC/WorkloadManagementSystem/Agent/StatesMonitoringAgent.py diff --git a/WorkloadManagementSystem/Agent/__init__.py b/src/DIRAC/WorkloadManagementSystem/Agent/__init__.py similarity index 100% rename from WorkloadManagementSystem/Agent/__init__.py rename to src/DIRAC/WorkloadManagementSystem/Agent/__init__.py diff --git a/WorkloadManagementSystem/Agent/test/Test_Agent_JobAgent.py b/src/DIRAC/WorkloadManagementSystem/Agent/test/Test_Agent_JobAgent.py similarity index 100% rename from WorkloadManagementSystem/Agent/test/Test_Agent_JobAgent.py rename to src/DIRAC/WorkloadManagementSystem/Agent/test/Test_Agent_JobAgent.py diff --git a/WorkloadManagementSystem/Agent/test/Test_Agent_JobCleaningAgent.py b/src/DIRAC/WorkloadManagementSystem/Agent/test/Test_Agent_JobCleaningAgent.py similarity index 100% rename from WorkloadManagementSystem/Agent/test/Test_Agent_JobCleaningAgent.py rename to src/DIRAC/WorkloadManagementSystem/Agent/test/Test_Agent_JobCleaningAgent.py diff --git a/WorkloadManagementSystem/Agent/test/Test_Agent_PilotStatusAgent.py b/src/DIRAC/WorkloadManagementSystem/Agent/test/Test_Agent_PilotStatusAgent.py similarity index 100% rename from WorkloadManagementSystem/Agent/test/Test_Agent_PilotStatusAgent.py rename to src/DIRAC/WorkloadManagementSystem/Agent/test/Test_Agent_PilotStatusAgent.py diff --git a/WorkloadManagementSystem/Agent/test/Test_Agent_SiteDirector.py b/src/DIRAC/WorkloadManagementSystem/Agent/test/Test_Agent_SiteDirector.py similarity index 100% rename from WorkloadManagementSystem/Agent/test/Test_Agent_SiteDirector.py rename to src/DIRAC/WorkloadManagementSystem/Agent/test/Test_Agent_SiteDirector.py diff --git a/WorkloadManagementSystem/Agent/test/Test_Agent_StalledJobAgent.py b/src/DIRAC/WorkloadManagementSystem/Agent/test/Test_Agent_StalledJobAgent.py similarity index 100% rename from WorkloadManagementSystem/Agent/test/Test_Agent_StalledJobAgent.py rename to src/DIRAC/WorkloadManagementSystem/Agent/test/Test_Agent_StalledJobAgent.py diff --git a/WorkloadManagementSystem/Client/CPUNormalization.py b/src/DIRAC/WorkloadManagementSystem/Client/CPUNormalization.py similarity index 100% rename from WorkloadManagementSystem/Client/CPUNormalization.py rename to src/DIRAC/WorkloadManagementSystem/Client/CPUNormalization.py diff --git a/WorkloadManagementSystem/Client/DIRACbenchmark.py b/src/DIRAC/WorkloadManagementSystem/Client/DIRACbenchmark.py similarity index 100% rename from WorkloadManagementSystem/Client/DIRACbenchmark.py rename to src/DIRAC/WorkloadManagementSystem/Client/DIRACbenchmark.py diff --git a/WorkloadManagementSystem/Client/DownloadInputData.py b/src/DIRAC/WorkloadManagementSystem/Client/DownloadInputData.py similarity index 100% rename from WorkloadManagementSystem/Client/DownloadInputData.py rename to src/DIRAC/WorkloadManagementSystem/Client/DownloadInputData.py diff --git a/WorkloadManagementSystem/Client/InputDataByProtocol.py b/src/DIRAC/WorkloadManagementSystem/Client/InputDataByProtocol.py similarity index 100% rename from WorkloadManagementSystem/Client/InputDataByProtocol.py rename to src/DIRAC/WorkloadManagementSystem/Client/InputDataByProtocol.py diff --git a/WorkloadManagementSystem/Client/InputDataResolution.py b/src/DIRAC/WorkloadManagementSystem/Client/InputDataResolution.py similarity index 100% rename from WorkloadManagementSystem/Client/InputDataResolution.py rename to src/DIRAC/WorkloadManagementSystem/Client/InputDataResolution.py diff --git a/WorkloadManagementSystem/Client/JobManagerClient.py b/src/DIRAC/WorkloadManagementSystem/Client/JobManagerClient.py similarity index 100% rename from WorkloadManagementSystem/Client/JobManagerClient.py rename to src/DIRAC/WorkloadManagementSystem/Client/JobManagerClient.py diff --git a/WorkloadManagementSystem/Client/JobMonitoringClient.py b/src/DIRAC/WorkloadManagementSystem/Client/JobMonitoringClient.py similarity index 100% rename from WorkloadManagementSystem/Client/JobMonitoringClient.py rename to src/DIRAC/WorkloadManagementSystem/Client/JobMonitoringClient.py diff --git a/WorkloadManagementSystem/Client/JobReport.py b/src/DIRAC/WorkloadManagementSystem/Client/JobReport.py similarity index 100% rename from WorkloadManagementSystem/Client/JobReport.py rename to src/DIRAC/WorkloadManagementSystem/Client/JobReport.py diff --git a/WorkloadManagementSystem/Client/JobState/CachedJobState.py b/src/DIRAC/WorkloadManagementSystem/Client/JobState/CachedJobState.py similarity index 100% rename from WorkloadManagementSystem/Client/JobState/CachedJobState.py rename to src/DIRAC/WorkloadManagementSystem/Client/JobState/CachedJobState.py diff --git a/WorkloadManagementSystem/Client/JobState/JobManifest.py b/src/DIRAC/WorkloadManagementSystem/Client/JobState/JobManifest.py similarity index 100% rename from WorkloadManagementSystem/Client/JobState/JobManifest.py rename to src/DIRAC/WorkloadManagementSystem/Client/JobState/JobManifest.py diff --git a/WorkloadManagementSystem/Client/JobState/JobState.py b/src/DIRAC/WorkloadManagementSystem/Client/JobState/JobState.py similarity index 100% rename from WorkloadManagementSystem/Client/JobState/JobState.py rename to src/DIRAC/WorkloadManagementSystem/Client/JobState/JobState.py diff --git a/WorkloadManagementSystem/Client/JobState/__init__.py b/src/DIRAC/WorkloadManagementSystem/Client/JobState/__init__.py similarity index 100% rename from WorkloadManagementSystem/Client/JobState/__init__.py rename to src/DIRAC/WorkloadManagementSystem/Client/JobState/__init__.py diff --git a/WorkloadManagementSystem/Client/JobStateUpdateClient.py b/src/DIRAC/WorkloadManagementSystem/Client/JobStateUpdateClient.py similarity index 100% rename from WorkloadManagementSystem/Client/JobStateUpdateClient.py rename to src/DIRAC/WorkloadManagementSystem/Client/JobStateUpdateClient.py diff --git a/WorkloadManagementSystem/Client/JobStatus.py b/src/DIRAC/WorkloadManagementSystem/Client/JobStatus.py similarity index 100% rename from WorkloadManagementSystem/Client/JobStatus.py rename to src/DIRAC/WorkloadManagementSystem/Client/JobStatus.py diff --git a/WorkloadManagementSystem/Client/Limiter.py b/src/DIRAC/WorkloadManagementSystem/Client/Limiter.py similarity index 100% rename from WorkloadManagementSystem/Client/Limiter.py rename to src/DIRAC/WorkloadManagementSystem/Client/Limiter.py diff --git a/WorkloadManagementSystem/Client/Matcher.py b/src/DIRAC/WorkloadManagementSystem/Client/Matcher.py similarity index 100% rename from WorkloadManagementSystem/Client/Matcher.py rename to src/DIRAC/WorkloadManagementSystem/Client/Matcher.py diff --git a/WorkloadManagementSystem/Client/MatcherClient.py b/src/DIRAC/WorkloadManagementSystem/Client/MatcherClient.py similarity index 100% rename from WorkloadManagementSystem/Client/MatcherClient.py rename to src/DIRAC/WorkloadManagementSystem/Client/MatcherClient.py diff --git a/WorkloadManagementSystem/Client/PilotManagerClient.py b/src/DIRAC/WorkloadManagementSystem/Client/PilotManagerClient.py similarity index 100% rename from WorkloadManagementSystem/Client/PilotManagerClient.py rename to src/DIRAC/WorkloadManagementSystem/Client/PilotManagerClient.py diff --git a/WorkloadManagementSystem/Client/PilotsLoggingClient.py b/src/DIRAC/WorkloadManagementSystem/Client/PilotsLoggingClient.py similarity index 100% rename from WorkloadManagementSystem/Client/PilotsLoggingClient.py rename to src/DIRAC/WorkloadManagementSystem/Client/PilotsLoggingClient.py diff --git a/WorkloadManagementSystem/Client/PoolXMLSlice.py b/src/DIRAC/WorkloadManagementSystem/Client/PoolXMLSlice.py similarity index 100% rename from WorkloadManagementSystem/Client/PoolXMLSlice.py rename to src/DIRAC/WorkloadManagementSystem/Client/PoolXMLSlice.py diff --git a/WorkloadManagementSystem/Client/SandboxStoreClient.py b/src/DIRAC/WorkloadManagementSystem/Client/SandboxStoreClient.py similarity index 100% rename from WorkloadManagementSystem/Client/SandboxStoreClient.py rename to src/DIRAC/WorkloadManagementSystem/Client/SandboxStoreClient.py diff --git a/WorkloadManagementSystem/Client/ServerUtils.py b/src/DIRAC/WorkloadManagementSystem/Client/ServerUtils.py similarity index 100% rename from WorkloadManagementSystem/Client/ServerUtils.py rename to src/DIRAC/WorkloadManagementSystem/Client/ServerUtils.py diff --git a/WorkloadManagementSystem/Client/WMSAdministratorClient.py b/src/DIRAC/WorkloadManagementSystem/Client/WMSAdministratorClient.py similarity index 100% rename from WorkloadManagementSystem/Client/WMSAdministratorClient.py rename to src/DIRAC/WorkloadManagementSystem/Client/WMSAdministratorClient.py diff --git a/WorkloadManagementSystem/Client/WMSClient.py b/src/DIRAC/WorkloadManagementSystem/Client/WMSClient.py similarity index 100% rename from WorkloadManagementSystem/Client/WMSClient.py rename to src/DIRAC/WorkloadManagementSystem/Client/WMSClient.py diff --git a/WorkloadManagementSystem/Client/__init__.py b/src/DIRAC/WorkloadManagementSystem/Client/__init__.py similarity index 100% rename from WorkloadManagementSystem/Client/__init__.py rename to src/DIRAC/WorkloadManagementSystem/Client/__init__.py diff --git a/WorkloadManagementSystem/Client/test/Test_Client_DownloadInputData.py b/src/DIRAC/WorkloadManagementSystem/Client/test/Test_Client_DownloadInputData.py similarity index 100% rename from WorkloadManagementSystem/Client/test/Test_Client_DownloadInputData.py rename to src/DIRAC/WorkloadManagementSystem/Client/test/Test_Client_DownloadInputData.py diff --git a/WorkloadManagementSystem/Client/test/Test_Client_WorkloadManagementSystem.py b/src/DIRAC/WorkloadManagementSystem/Client/test/Test_Client_WorkloadManagementSystem.py similarity index 100% rename from WorkloadManagementSystem/Client/test/Test_Client_WorkloadManagementSystem.py rename to src/DIRAC/WorkloadManagementSystem/Client/test/Test_Client_WorkloadManagementSystem.py diff --git a/WorkloadManagementSystem/ConfigTemplate.cfg b/src/DIRAC/WorkloadManagementSystem/ConfigTemplate.cfg similarity index 100% rename from WorkloadManagementSystem/ConfigTemplate.cfg rename to src/DIRAC/WorkloadManagementSystem/ConfigTemplate.cfg diff --git a/WorkloadManagementSystem/DB/ElasticJobParametersDB.py b/src/DIRAC/WorkloadManagementSystem/DB/ElasticJobParametersDB.py similarity index 100% rename from WorkloadManagementSystem/DB/ElasticJobParametersDB.py rename to src/DIRAC/WorkloadManagementSystem/DB/ElasticJobParametersDB.py diff --git a/WorkloadManagementSystem/DB/JobDB.py b/src/DIRAC/WorkloadManagementSystem/DB/JobDB.py similarity index 100% rename from WorkloadManagementSystem/DB/JobDB.py rename to src/DIRAC/WorkloadManagementSystem/DB/JobDB.py diff --git a/WorkloadManagementSystem/DB/JobDB.sql b/src/DIRAC/WorkloadManagementSystem/DB/JobDB.sql similarity index 100% rename from WorkloadManagementSystem/DB/JobDB.sql rename to src/DIRAC/WorkloadManagementSystem/DB/JobDB.sql diff --git a/WorkloadManagementSystem/DB/JobLoggingDB.py b/src/DIRAC/WorkloadManagementSystem/DB/JobLoggingDB.py similarity index 100% rename from WorkloadManagementSystem/DB/JobLoggingDB.py rename to src/DIRAC/WorkloadManagementSystem/DB/JobLoggingDB.py diff --git a/WorkloadManagementSystem/DB/JobLoggingDB.sql b/src/DIRAC/WorkloadManagementSystem/DB/JobLoggingDB.sql similarity index 100% rename from WorkloadManagementSystem/DB/JobLoggingDB.sql rename to src/DIRAC/WorkloadManagementSystem/DB/JobLoggingDB.sql diff --git a/WorkloadManagementSystem/DB/PilotAgentsDB.py b/src/DIRAC/WorkloadManagementSystem/DB/PilotAgentsDB.py similarity index 100% rename from WorkloadManagementSystem/DB/PilotAgentsDB.py rename to src/DIRAC/WorkloadManagementSystem/DB/PilotAgentsDB.py diff --git a/WorkloadManagementSystem/DB/PilotAgentsDB.sql b/src/DIRAC/WorkloadManagementSystem/DB/PilotAgentsDB.sql similarity index 100% rename from WorkloadManagementSystem/DB/PilotAgentsDB.sql rename to src/DIRAC/WorkloadManagementSystem/DB/PilotAgentsDB.sql diff --git a/WorkloadManagementSystem/DB/PilotsLoggingDB.py b/src/DIRAC/WorkloadManagementSystem/DB/PilotsLoggingDB.py similarity index 100% rename from WorkloadManagementSystem/DB/PilotsLoggingDB.py rename to src/DIRAC/WorkloadManagementSystem/DB/PilotsLoggingDB.py diff --git a/WorkloadManagementSystem/DB/PilotsLoggingDB.sql b/src/DIRAC/WorkloadManagementSystem/DB/PilotsLoggingDB.sql similarity index 100% rename from WorkloadManagementSystem/DB/PilotsLoggingDB.sql rename to src/DIRAC/WorkloadManagementSystem/DB/PilotsLoggingDB.sql diff --git a/WorkloadManagementSystem/DB/SandboxMetadataDB.py b/src/DIRAC/WorkloadManagementSystem/DB/SandboxMetadataDB.py similarity index 100% rename from WorkloadManagementSystem/DB/SandboxMetadataDB.py rename to src/DIRAC/WorkloadManagementSystem/DB/SandboxMetadataDB.py diff --git a/WorkloadManagementSystem/DB/SandboxMetadataDB.sql b/src/DIRAC/WorkloadManagementSystem/DB/SandboxMetadataDB.sql similarity index 100% rename from WorkloadManagementSystem/DB/SandboxMetadataDB.sql rename to src/DIRAC/WorkloadManagementSystem/DB/SandboxMetadataDB.sql diff --git a/WorkloadManagementSystem/DB/TaskQueueDB.py b/src/DIRAC/WorkloadManagementSystem/DB/TaskQueueDB.py similarity index 100% rename from WorkloadManagementSystem/DB/TaskQueueDB.py rename to src/DIRAC/WorkloadManagementSystem/DB/TaskQueueDB.py diff --git a/WorkloadManagementSystem/DB/TaskQueueDB.sql b/src/DIRAC/WorkloadManagementSystem/DB/TaskQueueDB.sql similarity index 100% rename from WorkloadManagementSystem/DB/TaskQueueDB.sql rename to src/DIRAC/WorkloadManagementSystem/DB/TaskQueueDB.sql diff --git a/WorkloadManagementSystem/DB/__init__.py b/src/DIRAC/WorkloadManagementSystem/DB/__init__.py similarity index 100% rename from WorkloadManagementSystem/DB/__init__.py rename to src/DIRAC/WorkloadManagementSystem/DB/__init__.py diff --git a/WorkloadManagementSystem/DB/tests/Test_JobDB.py b/src/DIRAC/WorkloadManagementSystem/DB/tests/Test_JobDB.py similarity index 100% rename from WorkloadManagementSystem/DB/tests/Test_JobDB.py rename to src/DIRAC/WorkloadManagementSystem/DB/tests/Test_JobDB.py diff --git a/WorkloadManagementSystem/Executor/Base/OptimizerExecutor.py b/src/DIRAC/WorkloadManagementSystem/Executor/Base/OptimizerExecutor.py similarity index 100% rename from WorkloadManagementSystem/Executor/Base/OptimizerExecutor.py rename to src/DIRAC/WorkloadManagementSystem/Executor/Base/OptimizerExecutor.py diff --git a/WorkloadManagementSystem/Executor/Base/__init__.py b/src/DIRAC/WorkloadManagementSystem/Executor/Base/__init__.py similarity index 100% rename from WorkloadManagementSystem/Executor/Base/__init__.py rename to src/DIRAC/WorkloadManagementSystem/Executor/Base/__init__.py diff --git a/WorkloadManagementSystem/Executor/InputData.py b/src/DIRAC/WorkloadManagementSystem/Executor/InputData.py similarity index 100% rename from WorkloadManagementSystem/Executor/InputData.py rename to src/DIRAC/WorkloadManagementSystem/Executor/InputData.py diff --git a/WorkloadManagementSystem/Executor/JobPath.py b/src/DIRAC/WorkloadManagementSystem/Executor/JobPath.py similarity index 100% rename from WorkloadManagementSystem/Executor/JobPath.py rename to src/DIRAC/WorkloadManagementSystem/Executor/JobPath.py diff --git a/WorkloadManagementSystem/Executor/JobSanity.py b/src/DIRAC/WorkloadManagementSystem/Executor/JobSanity.py similarity index 100% rename from WorkloadManagementSystem/Executor/JobSanity.py rename to src/DIRAC/WorkloadManagementSystem/Executor/JobSanity.py diff --git a/WorkloadManagementSystem/Executor/JobScheduling.py b/src/DIRAC/WorkloadManagementSystem/Executor/JobScheduling.py similarity index 100% rename from WorkloadManagementSystem/Executor/JobScheduling.py rename to src/DIRAC/WorkloadManagementSystem/Executor/JobScheduling.py diff --git a/WorkloadManagementSystem/Executor/__init__.py b/src/DIRAC/WorkloadManagementSystem/Executor/__init__.py similarity index 100% rename from WorkloadManagementSystem/Executor/__init__.py rename to src/DIRAC/WorkloadManagementSystem/Executor/__init__.py diff --git a/WorkloadManagementSystem/Executor/test/Test_Executor.py b/src/DIRAC/WorkloadManagementSystem/Executor/test/Test_Executor.py similarity index 100% rename from WorkloadManagementSystem/Executor/test/Test_Executor.py rename to src/DIRAC/WorkloadManagementSystem/Executor/test/Test_Executor.py diff --git a/WorkloadManagementSystem/JobWrapper/JobWrapper.py b/src/DIRAC/WorkloadManagementSystem/JobWrapper/JobWrapper.py similarity index 100% rename from WorkloadManagementSystem/JobWrapper/JobWrapper.py rename to src/DIRAC/WorkloadManagementSystem/JobWrapper/JobWrapper.py diff --git a/WorkloadManagementSystem/JobWrapper/JobWrapperTemplate.py b/src/DIRAC/WorkloadManagementSystem/JobWrapper/JobWrapperTemplate.py similarity index 100% rename from WorkloadManagementSystem/JobWrapper/JobWrapperTemplate.py rename to src/DIRAC/WorkloadManagementSystem/JobWrapper/JobWrapperTemplate.py diff --git a/WorkloadManagementSystem/JobWrapper/Watchdog.py b/src/DIRAC/WorkloadManagementSystem/JobWrapper/Watchdog.py similarity index 100% rename from WorkloadManagementSystem/JobWrapper/Watchdog.py rename to src/DIRAC/WorkloadManagementSystem/JobWrapper/Watchdog.py diff --git a/WorkloadManagementSystem/JobWrapper/__init__.py b/src/DIRAC/WorkloadManagementSystem/JobWrapper/__init__.py similarity index 100% rename from WorkloadManagementSystem/JobWrapper/__init__.py rename to src/DIRAC/WorkloadManagementSystem/JobWrapper/__init__.py diff --git a/WorkloadManagementSystem/JobWrapper/test/Test_JobWrapper.py b/src/DIRAC/WorkloadManagementSystem/JobWrapper/test/Test_JobWrapper.py similarity index 93% rename from WorkloadManagementSystem/JobWrapper/test/Test_JobWrapper.py rename to src/DIRAC/WorkloadManagementSystem/JobWrapper/test/Test_JobWrapper.py index 9d8080229f4..8ff477913d1 100644 --- a/WorkloadManagementSystem/JobWrapper/test/Test_JobWrapper.py +++ b/src/DIRAC/WorkloadManagementSystem/JobWrapper/test/Test_JobWrapper.py @@ -10,6 +10,7 @@ import unittest import importlib import os +from os.path import dirname, join import shutil from mock import MagicMock, patch @@ -89,14 +90,14 @@ def test_execute(self, _patch1, _patch2): print('jw.execute() returns', str(res)) self.assertTrue(res['OK']) - shutil.copy('WorkloadManagementSystem/JobWrapper/test/script-OK.sh', 'script-OK.sh') + shutil.copy(join(dirname(__file__), 'script-OK.sh'), 'script-OK.sh') jw = JobWrapper() jw.jobArgs = {'Executable': 'script-OK.sh'} res = jw.execute() self.assertTrue(res['OK']) os.remove('script-OK.sh') - shutil.copy('WorkloadManagementSystem/JobWrapper/test/script.sh', 'script.sh') + shutil.copy(join(dirname(__file__), 'script.sh'), 'script.sh') jw = JobWrapper() jw.jobArgs = {'Executable': 'script.sh', 'Arguments': '111'} res = jw.execute() @@ -104,7 +105,7 @@ def test_execute(self, _patch1, _patch2): # but the JobWrapper executed successfully os.remove('script.sh') - shutil.copy('WorkloadManagementSystem/JobWrapper/test/script-RESC.sh', 'script-RESC.sh') # this will reschedule + shutil.copy(join(dirname(__file__), 'script-RESC.sh'), 'script-RESC.sh') # this will reschedule jw = JobWrapper() jw.jobArgs = {'Executable': 'script-RESC.sh'} res = jw.execute() diff --git a/WorkloadManagementSystem/JobWrapper/test/Test_Watchdog.py b/src/DIRAC/WorkloadManagementSystem/JobWrapper/test/Test_Watchdog.py similarity index 100% rename from WorkloadManagementSystem/JobWrapper/test/Test_Watchdog.py rename to src/DIRAC/WorkloadManagementSystem/JobWrapper/test/Test_Watchdog.py diff --git a/WorkloadManagementSystem/JobWrapper/test/__init__.py b/src/DIRAC/WorkloadManagementSystem/JobWrapper/test/__init__.py similarity index 100% rename from WorkloadManagementSystem/JobWrapper/test/__init__.py rename to src/DIRAC/WorkloadManagementSystem/JobWrapper/test/__init__.py diff --git a/WorkloadManagementSystem/JobWrapper/test/script-OK.sh b/src/DIRAC/WorkloadManagementSystem/JobWrapper/test/script-OK.sh similarity index 100% rename from WorkloadManagementSystem/JobWrapper/test/script-OK.sh rename to src/DIRAC/WorkloadManagementSystem/JobWrapper/test/script-OK.sh diff --git a/WorkloadManagementSystem/JobWrapper/test/script-RESC.sh b/src/DIRAC/WorkloadManagementSystem/JobWrapper/test/script-RESC.sh similarity index 100% rename from WorkloadManagementSystem/JobWrapper/test/script-RESC.sh rename to src/DIRAC/WorkloadManagementSystem/JobWrapper/test/script-RESC.sh diff --git a/WorkloadManagementSystem/JobWrapper/test/script.sh b/src/DIRAC/WorkloadManagementSystem/JobWrapper/test/script.sh similarity index 100% rename from WorkloadManagementSystem/JobWrapper/test/script.sh rename to src/DIRAC/WorkloadManagementSystem/JobWrapper/test/script.sh diff --git a/WorkloadManagementSystem/Service/JobManagerHandler.py b/src/DIRAC/WorkloadManagementSystem/Service/JobManagerHandler.py similarity index 100% rename from WorkloadManagementSystem/Service/JobManagerHandler.py rename to src/DIRAC/WorkloadManagementSystem/Service/JobManagerHandler.py diff --git a/WorkloadManagementSystem/Service/JobMonitoringHandler.py b/src/DIRAC/WorkloadManagementSystem/Service/JobMonitoringHandler.py similarity index 100% rename from WorkloadManagementSystem/Service/JobMonitoringHandler.py rename to src/DIRAC/WorkloadManagementSystem/Service/JobMonitoringHandler.py diff --git a/WorkloadManagementSystem/Service/JobPolicy.py b/src/DIRAC/WorkloadManagementSystem/Service/JobPolicy.py similarity index 100% rename from WorkloadManagementSystem/Service/JobPolicy.py rename to src/DIRAC/WorkloadManagementSystem/Service/JobPolicy.py diff --git a/WorkloadManagementSystem/Service/JobStateUpdateHandler.py b/src/DIRAC/WorkloadManagementSystem/Service/JobStateUpdateHandler.py similarity index 100% rename from WorkloadManagementSystem/Service/JobStateUpdateHandler.py rename to src/DIRAC/WorkloadManagementSystem/Service/JobStateUpdateHandler.py diff --git a/WorkloadManagementSystem/Service/MatcherHandler.py b/src/DIRAC/WorkloadManagementSystem/Service/MatcherHandler.py similarity index 100% rename from WorkloadManagementSystem/Service/MatcherHandler.py rename to src/DIRAC/WorkloadManagementSystem/Service/MatcherHandler.py diff --git a/WorkloadManagementSystem/Service/OptimizationMindHandler.py b/src/DIRAC/WorkloadManagementSystem/Service/OptimizationMindHandler.py similarity index 100% rename from WorkloadManagementSystem/Service/OptimizationMindHandler.py rename to src/DIRAC/WorkloadManagementSystem/Service/OptimizationMindHandler.py diff --git a/WorkloadManagementSystem/Service/PilotManagerHandler.py b/src/DIRAC/WorkloadManagementSystem/Service/PilotManagerHandler.py similarity index 100% rename from WorkloadManagementSystem/Service/PilotManagerHandler.py rename to src/DIRAC/WorkloadManagementSystem/Service/PilotManagerHandler.py diff --git a/WorkloadManagementSystem/Service/PilotsLoggingHandler.py b/src/DIRAC/WorkloadManagementSystem/Service/PilotsLoggingHandler.py similarity index 100% rename from WorkloadManagementSystem/Service/PilotsLoggingHandler.py rename to src/DIRAC/WorkloadManagementSystem/Service/PilotsLoggingHandler.py diff --git a/WorkloadManagementSystem/Service/SandboxStoreHandler.py b/src/DIRAC/WorkloadManagementSystem/Service/SandboxStoreHandler.py similarity index 100% rename from WorkloadManagementSystem/Service/SandboxStoreHandler.py rename to src/DIRAC/WorkloadManagementSystem/Service/SandboxStoreHandler.py diff --git a/WorkloadManagementSystem/Service/WMSAdministratorHandler.py b/src/DIRAC/WorkloadManagementSystem/Service/WMSAdministratorHandler.py similarity index 100% rename from WorkloadManagementSystem/Service/WMSAdministratorHandler.py rename to src/DIRAC/WorkloadManagementSystem/Service/WMSAdministratorHandler.py diff --git a/WorkloadManagementSystem/Service/WMSUtilities.py b/src/DIRAC/WorkloadManagementSystem/Service/WMSUtilities.py similarity index 100% rename from WorkloadManagementSystem/Service/WMSUtilities.py rename to src/DIRAC/WorkloadManagementSystem/Service/WMSUtilities.py diff --git a/WorkloadManagementSystem/Service/__init__.py b/src/DIRAC/WorkloadManagementSystem/Service/__init__.py similarity index 100% rename from WorkloadManagementSystem/Service/__init__.py rename to src/DIRAC/WorkloadManagementSystem/Service/__init__.py diff --git a/WorkloadManagementSystem/Utilities/JobParameters.py b/src/DIRAC/WorkloadManagementSystem/Utilities/JobParameters.py similarity index 100% rename from WorkloadManagementSystem/Utilities/JobParameters.py rename to src/DIRAC/WorkloadManagementSystem/Utilities/JobParameters.py diff --git a/WorkloadManagementSystem/Utilities/ParametricJob.py b/src/DIRAC/WorkloadManagementSystem/Utilities/ParametricJob.py similarity index 100% rename from WorkloadManagementSystem/Utilities/ParametricJob.py rename to src/DIRAC/WorkloadManagementSystem/Utilities/ParametricJob.py diff --git a/WorkloadManagementSystem/Utilities/PilotCStoJSONSynchronizer.py b/src/DIRAC/WorkloadManagementSystem/Utilities/PilotCStoJSONSynchronizer.py similarity index 100% rename from WorkloadManagementSystem/Utilities/PilotCStoJSONSynchronizer.py rename to src/DIRAC/WorkloadManagementSystem/Utilities/PilotCStoJSONSynchronizer.py diff --git a/WorkloadManagementSystem/Utilities/PilotWrapper.py b/src/DIRAC/WorkloadManagementSystem/Utilities/PilotWrapper.py similarity index 100% rename from WorkloadManagementSystem/Utilities/PilotWrapper.py rename to src/DIRAC/WorkloadManagementSystem/Utilities/PilotWrapper.py diff --git a/WorkloadManagementSystem/Utilities/QueueUtilities.py b/src/DIRAC/WorkloadManagementSystem/Utilities/QueueUtilities.py similarity index 100% rename from WorkloadManagementSystem/Utilities/QueueUtilities.py rename to src/DIRAC/WorkloadManagementSystem/Utilities/QueueUtilities.py diff --git a/WorkloadManagementSystem/Utilities/Utils.py b/src/DIRAC/WorkloadManagementSystem/Utilities/Utils.py similarity index 100% rename from WorkloadManagementSystem/Utilities/Utils.py rename to src/DIRAC/WorkloadManagementSystem/Utilities/Utils.py diff --git a/WorkloadManagementSystem/Utilities/__init__.py b/src/DIRAC/WorkloadManagementSystem/Utilities/__init__.py similarity index 100% rename from WorkloadManagementSystem/Utilities/__init__.py rename to src/DIRAC/WorkloadManagementSystem/Utilities/__init__.py diff --git a/WorkloadManagementSystem/Utilities/test/Test_ParametricJob.py b/src/DIRAC/WorkloadManagementSystem/Utilities/test/Test_ParametricJob.py similarity index 100% rename from WorkloadManagementSystem/Utilities/test/Test_ParametricJob.py rename to src/DIRAC/WorkloadManagementSystem/Utilities/test/Test_ParametricJob.py diff --git a/WorkloadManagementSystem/Utilities/test/Test_PilotCStoJSONSynchronizer.py b/src/DIRAC/WorkloadManagementSystem/Utilities/test/Test_PilotCStoJSONSynchronizer.py similarity index 100% rename from WorkloadManagementSystem/Utilities/test/Test_PilotCStoJSONSynchronizer.py rename to src/DIRAC/WorkloadManagementSystem/Utilities/test/Test_PilotCStoJSONSynchronizer.py diff --git a/WorkloadManagementSystem/Utilities/test/Test_PilotWrapper.py b/src/DIRAC/WorkloadManagementSystem/Utilities/test/Test_PilotWrapper.py similarity index 87% rename from WorkloadManagementSystem/Utilities/test/Test_PilotWrapper.py rename to src/DIRAC/WorkloadManagementSystem/Utilities/test/Test_PilotWrapper.py index c5b36fe4e7e..89d527d2830 100644 --- a/WorkloadManagementSystem/Utilities/test/Test_PilotWrapper.py +++ b/src/DIRAC/WorkloadManagementSystem/Utilities/test/Test_PilotWrapper.py @@ -38,22 +38,22 @@ def test_scriptoptions(): def test_scriptReal(): """ test script creation """ - diracInstall = os.path.join(os.getcwd(), 'Core/scripts/dirac-install.py') + diracInstall = os.path.join(os.getcwd(), 'src/DIRAC/Core/scripts/dirac-install.py') with open(diracInstall, "rb") as fd: diracInstall = fd.read() diracInstallEncoded = base64.b64encode(bz2.compress(diracInstall, 9)) - diracPilot = os.path.join(os.getcwd(), 'Core/scripts/dirac-install.py') # just some random file + diracPilot = os.path.join(os.getcwd(), 'src/DIRAC/Core/scripts/dirac-install.py') # just some random file with open(diracPilot, "rb") as fd: diracPilot = fd.read() diracPilotEncoded = base64.b64encode(bz2.compress(diracPilot, 9)) - diracPilotTools = os.path.join(os.getcwd(), 'Core/scripts/dirac-install.py') # just some random file + diracPilotTools = os.path.join(os.getcwd(), 'src/DIRAC/Core/scripts/dirac-install.py') # just some random file with open(diracPilotTools, "rb") as fd: diracPilotTools = fd.read() diracPilotToolsEncoded = base64.b64encode(bz2.compress(diracPilotTools, 9)) - diracPilotCommands = os.path.join(os.getcwd(), 'Core/scripts/dirac-install.py') # just some random file + diracPilotCommands = os.path.join(os.getcwd(), 'src/DIRAC/Core/scripts/dirac-install.py') # just some random file with open(diracPilotCommands, "rb") as fd: diracPilotCommands = fd.read() diracPilotCommandsEncoded = base64.b64encode(bz2.compress(diracPilotCommands, 9)) diff --git a/WorkloadManagementSystem/__init__.py b/src/DIRAC/WorkloadManagementSystem/__init__.py similarity index 100% rename from WorkloadManagementSystem/__init__.py rename to src/DIRAC/WorkloadManagementSystem/__init__.py diff --git a/WorkloadManagementSystem/private/ConfigHelper.py b/src/DIRAC/WorkloadManagementSystem/private/ConfigHelper.py similarity index 100% rename from WorkloadManagementSystem/private/ConfigHelper.py rename to src/DIRAC/WorkloadManagementSystem/private/ConfigHelper.py diff --git a/WorkloadManagementSystem/private/SharesCorrector.py b/src/DIRAC/WorkloadManagementSystem/private/SharesCorrector.py similarity index 100% rename from WorkloadManagementSystem/private/SharesCorrector.py rename to src/DIRAC/WorkloadManagementSystem/private/SharesCorrector.py diff --git a/WorkloadManagementSystem/private/__init__.py b/src/DIRAC/WorkloadManagementSystem/private/__init__.py similarity index 100% rename from WorkloadManagementSystem/private/__init__.py rename to src/DIRAC/WorkloadManagementSystem/private/__init__.py diff --git a/WorkloadManagementSystem/private/correctors/BaseCorrector.py b/src/DIRAC/WorkloadManagementSystem/private/correctors/BaseCorrector.py similarity index 100% rename from WorkloadManagementSystem/private/correctors/BaseCorrector.py rename to src/DIRAC/WorkloadManagementSystem/private/correctors/BaseCorrector.py diff --git a/WorkloadManagementSystem/private/correctors/BaseHistoryCorrector.py b/src/DIRAC/WorkloadManagementSystem/private/correctors/BaseHistoryCorrector.py similarity index 100% rename from WorkloadManagementSystem/private/correctors/BaseHistoryCorrector.py rename to src/DIRAC/WorkloadManagementSystem/private/correctors/BaseHistoryCorrector.py diff --git a/WorkloadManagementSystem/private/correctors/MonitoringHistoryCorrector.py b/src/DIRAC/WorkloadManagementSystem/private/correctors/MonitoringHistoryCorrector.py similarity index 100% rename from WorkloadManagementSystem/private/correctors/MonitoringHistoryCorrector.py rename to src/DIRAC/WorkloadManagementSystem/private/correctors/MonitoringHistoryCorrector.py diff --git a/WorkloadManagementSystem/private/correctors/WMSHistoryCorrector.py b/src/DIRAC/WorkloadManagementSystem/private/correctors/WMSHistoryCorrector.py similarity index 100% rename from WorkloadManagementSystem/private/correctors/WMSHistoryCorrector.py rename to src/DIRAC/WorkloadManagementSystem/private/correctors/WMSHistoryCorrector.py diff --git a/WorkloadManagementSystem/private/correctors/__init__.py b/src/DIRAC/WorkloadManagementSystem/private/correctors/__init__.py similarity index 100% rename from WorkloadManagementSystem/private/correctors/__init__.py rename to src/DIRAC/WorkloadManagementSystem/private/correctors/__init__.py diff --git a/WorkloadManagementSystem/scripts/dirac-admin-kill-pilot.py b/src/DIRAC/WorkloadManagementSystem/scripts/dirac-admin-kill-pilot.py similarity index 100% rename from WorkloadManagementSystem/scripts/dirac-admin-kill-pilot.py rename to src/DIRAC/WorkloadManagementSystem/scripts/dirac-admin-kill-pilot.py diff --git a/WorkloadManagementSystem/scripts/dirac-admin-pilot-logging-info.py b/src/DIRAC/WorkloadManagementSystem/scripts/dirac-admin-pilot-logging-info.py similarity index 100% rename from WorkloadManagementSystem/scripts/dirac-admin-pilot-logging-info.py rename to src/DIRAC/WorkloadManagementSystem/scripts/dirac-admin-pilot-logging-info.py diff --git a/WorkloadManagementSystem/scripts/dirac-admin-show-task-queues.py b/src/DIRAC/WorkloadManagementSystem/scripts/dirac-admin-show-task-queues.py similarity index 100% rename from WorkloadManagementSystem/scripts/dirac-admin-show-task-queues.py rename to src/DIRAC/WorkloadManagementSystem/scripts/dirac-admin-show-task-queues.py diff --git a/WorkloadManagementSystem/scripts/dirac-jobexec.py b/src/DIRAC/WorkloadManagementSystem/scripts/dirac-jobexec.py similarity index 100% rename from WorkloadManagementSystem/scripts/dirac-jobexec.py rename to src/DIRAC/WorkloadManagementSystem/scripts/dirac-jobexec.py diff --git a/WorkloadManagementSystem/scripts/dirac-wms-cpu-normalization.py b/src/DIRAC/WorkloadManagementSystem/scripts/dirac-wms-cpu-normalization.py similarity index 100% rename from WorkloadManagementSystem/scripts/dirac-wms-cpu-normalization.py rename to src/DIRAC/WorkloadManagementSystem/scripts/dirac-wms-cpu-normalization.py diff --git a/WorkloadManagementSystem/scripts/dirac-wms-get-queue-cpu-time.py b/src/DIRAC/WorkloadManagementSystem/scripts/dirac-wms-get-queue-cpu-time.py similarity index 100% rename from WorkloadManagementSystem/scripts/dirac-wms-get-queue-cpu-time.py rename to src/DIRAC/WorkloadManagementSystem/scripts/dirac-wms-get-queue-cpu-time.py diff --git a/WorkloadManagementSystem/scripts/dirac-wms-get-wn-parameters.py b/src/DIRAC/WorkloadManagementSystem/scripts/dirac-wms-get-wn-parameters.py similarity index 100% rename from WorkloadManagementSystem/scripts/dirac-wms-get-wn-parameters.py rename to src/DIRAC/WorkloadManagementSystem/scripts/dirac-wms-get-wn-parameters.py diff --git a/WorkloadManagementSystem/scripts/dirac-wms-get-wn.py b/src/DIRAC/WorkloadManagementSystem/scripts/dirac-wms-get-wn.py similarity index 100% rename from WorkloadManagementSystem/scripts/dirac-wms-get-wn.py rename to src/DIRAC/WorkloadManagementSystem/scripts/dirac-wms-get-wn.py diff --git a/WorkloadManagementSystem/scripts/dirac-wms-match.py b/src/DIRAC/WorkloadManagementSystem/scripts/dirac-wms-match.py similarity index 100% rename from WorkloadManagementSystem/scripts/dirac-wms-match.py rename to src/DIRAC/WorkloadManagementSystem/scripts/dirac-wms-match.py diff --git a/WorkloadManagementSystem/scripts/dirac-wms-pilot-job-info.py b/src/DIRAC/WorkloadManagementSystem/scripts/dirac-wms-pilot-job-info.py similarity index 100% rename from WorkloadManagementSystem/scripts/dirac-wms-pilot-job-info.py rename to src/DIRAC/WorkloadManagementSystem/scripts/dirac-wms-pilot-job-info.py diff --git a/__init__.py b/src/DIRAC/__init__.py similarity index 100% rename from __init__.py rename to src/DIRAC/__init__.py diff --git a/src/DIRAC/tests/Utilities/Accounting.py b/src/DIRAC/tests/Utilities/Accounting.py new file mode 100644 index 00000000000..7e762cebe51 --- /dev/null +++ b/src/DIRAC/tests/Utilities/Accounting.py @@ -0,0 +1,39 @@ +# pylint: disable=protected-access +from __future__ import print_function +from __future__ import absolute_import +from __future__ import division + +from DIRAC.AccountingSystem.Client.Types.DataOperation import DataOperation +from DIRAC.AccountingSystem.Client.Types.StorageOccupancy import StorageOccupancy + + +def createDataOperationAccountingRecord(): + accountingDict = {} + accountingDict['OperationType'] = 'putAndRegister' + accountingDict['User'] = 'system' + accountingDict['Protocol'] = 'DataManager' + accountingDict['RegistrationTime'] = 0.0 + accountingDict['RegistrationOK'] = 0 + accountingDict['RegistrationTotal'] = 0 + accountingDict['Destination'] = 'se' + accountingDict['TransferTotal'] = 1 + accountingDict['TransferOK'] = 1 + accountingDict['TransferSize'] = 1 + accountingDict['TransferTime'] = 0.0 + accountingDict['FinalStatus'] = 'Successful' + accountingDict['Source'] = 'testSite' + oDataOperation = DataOperation() + oDataOperation.setValuesFromDict(accountingDict) + return oDataOperation + + +def createStorageOccupancyAccountingRecord(): + accountingDict = {} + accountingDict['Site'] = 'LCG.PIPPO.it' + accountingDict['Endpoint'] = 'somewhere.in.topolinea.it' + accountingDict['StorageElement'] = 'PIPPO-SE' + accountingDict['SpaceType'] = 'Total' + accountingDict['Space'] = 123456 + oSO = StorageOccupancy() + oSO.setValuesFromDict(accountingDict) + return oSO diff --git a/tests/Utilities/IntegrationTest.py b/src/DIRAC/tests/Utilities/IntegrationTest.py similarity index 100% rename from tests/Utilities/IntegrationTest.py rename to src/DIRAC/tests/Utilities/IntegrationTest.py diff --git a/tests/Utilities/ProcessesCreator_withChildren.py b/src/DIRAC/tests/Utilities/ProcessesCreator_withChildren.py similarity index 100% rename from tests/Utilities/ProcessesCreator_withChildren.py rename to src/DIRAC/tests/Utilities/ProcessesCreator_withChildren.py diff --git a/src/DIRAC/tests/Utilities/WMS.py b/src/DIRAC/tests/Utilities/WMS.py new file mode 100644 index 00000000000..7056e05bf56 --- /dev/null +++ b/src/DIRAC/tests/Utilities/WMS.py @@ -0,0 +1,37 @@ +# pylint: disable=protected-access +from __future__ import print_function +from __future__ import absolute_import +from __future__ import division + +import tempfile + +from DIRAC.Interfaces.API.Job import Job +from DIRAC.tests.Utilities.utils import find_all + + +def helloWorldJob(): + job = Job() + job.setName("helloWorld") + exeScriptLocation = find_all('exe-script.py', '..', '/DIRAC/tests/Integration')[0] + job.setInputSandbox(exeScriptLocation) + job.setExecutable(exeScriptLocation, "", "helloWorld.log") + return job + + +def parametricJob(): + job = Job() + job.setName("parametric_helloWorld_%n") + exeScriptLocation = find_all('exe-script.py', '..', '/DIRAC/tests/Integration')[0] + job.setInputSandbox(exeScriptLocation) + job.setParameterSequence("args", ['one', 'two', 'three']) + job.setParameterSequence("iargs", [1, 2, 3]) + job.setExecutable(exeScriptLocation, arguments=": testing %(args)s %(iargs)s", logFile='helloWorld_%n.log') + return job + + +def createFile(job): + tmpdir = tempfile.mkdtemp() + jobDescription = tmpdir + '/jobDescription.xml' + with open(jobDescription, 'w') as fd: + fd.write(job._toXML()) + return jobDescription diff --git a/tests/Utilities/__init__.py b/src/DIRAC/tests/Utilities/__init__.py similarity index 100% rename from tests/Utilities/__init__.py rename to src/DIRAC/tests/Utilities/__init__.py diff --git a/tests/Utilities/assertingUtils.py b/src/DIRAC/tests/Utilities/assertingUtils.py similarity index 100% rename from tests/Utilities/assertingUtils.py rename to src/DIRAC/tests/Utilities/assertingUtils.py diff --git a/tests/Utilities/mpTest-flexible.py b/src/DIRAC/tests/Utilities/mpTest-flexible.py similarity index 100% rename from tests/Utilities/mpTest-flexible.py rename to src/DIRAC/tests/Utilities/mpTest-flexible.py diff --git a/tests/Utilities/mpTest.py b/src/DIRAC/tests/Utilities/mpTest.py similarity index 100% rename from tests/Utilities/mpTest.py rename to src/DIRAC/tests/Utilities/mpTest.py diff --git a/src/DIRAC/tests/Utilities/plots.py b/src/DIRAC/tests/Utilities/plots.py new file mode 100644 index 00000000000..4ee66db0baa --- /dev/null +++ b/src/DIRAC/tests/Utilities/plots.py @@ -0,0 +1,31 @@ +# pylint: disable=protected-access +from __future__ import print_function +from __future__ import absolute_import +from __future__ import division + +import math +import operator + +from PIL import Image + + +def compare(file1Path, file2Path): + """ + Function used to compare two plots + returns 0.0 if both are identical + + :param str file1Path: Path to the file1. + :param str file2Path: Path to the file2. + + :return: float value rms. + """ + + # Crops image to remove the "Generated on xxxx UTC" string + image1 = Image.open(file1Path).crop((0, 0, 800, 570)) + image2 = Image.open(file2Path).crop((0, 0, 800, 570)) + + h1 = image1.histogram() + h2 = image2.histogram() + rms = math.sqrt(reduce(operator.add, + map(lambda a, b: (a - b) ** 2, h1, h2)) / len(h1)) + return rms diff --git a/tests/Utilities/testJobDefinitions.py b/src/DIRAC/tests/Utilities/testJobDefinitions.py similarity index 100% rename from tests/Utilities/testJobDefinitions.py rename to src/DIRAC/tests/Utilities/testJobDefinitions.py diff --git a/tests/Utilities/utils.py b/src/DIRAC/tests/Utilities/utils.py similarity index 100% rename from tests/Utilities/utils.py rename to src/DIRAC/tests/Utilities/utils.py diff --git a/tests/__init__.py b/src/DIRAC/tests/__init__.py similarity index 100% rename from tests/__init__.py rename to src/DIRAC/tests/__init__.py diff --git a/tests/CI/run_docker_setup.sh b/tests/CI/run_docker_setup.sh index 985dbd17da2..a14d7280943 100755 --- a/tests/CI/run_docker_setup.sh +++ b/tests/CI/run_docker_setup.sh @@ -116,7 +116,7 @@ prepareEnvironment() { echo "ALTERNATIVE_MODULES+=(\"${module_path}\")" done else - echo "ALTERNATIVE_MODULES+=(\"${DIRAC_BASE_DIR}\")" + echo "ALTERNATIVE_MODULES+=(\"${DIRAC_BASE_DIR}/src/DIRAC\")" fi echo "declare -a INSTALLOPTIONS" @@ -138,8 +138,8 @@ prepareEnvironment() { echo "export DIRAC_RELEASE=integration" } >> "${SERVERCONFIG}" else - majorVersion=$(grep "majorVersion =" "${DIRAC_BASE_DIR}/__init__.py" | cut -d '=' -f 2) - minorVersion=$(grep "minorVersion =" "${DIRAC_BASE_DIR}/__init__.py" | cut -d '=' -f 2) + majorVersion=$(grep "majorVersion =" "${DIRAC_BASE_DIR}/src/DIRAC/__init__.py" | cut -d '=' -f 2) + minorVersion=$(grep "minorVersion =" "${DIRAC_BASE_DIR}/src/DIRAC/__init__.py" | cut -d '=' -f 2) { echo "export DIRACBRANCH=${DIRACBRANCH:-v${majorVersion// }r${minorVersion// }}" } >> "${SERVERCONFIG}" diff --git a/tests/Integration/AccountingSystem/Test_DataStoreClient.py b/tests/Integration/AccountingSystem/Test_DataStoreClient.py index 39178bfaf4e..05baeae30c8 100644 --- a/tests/Integration/AccountingSystem/Test_DataStoreClient.py +++ b/tests/Integration/AccountingSystem/Test_DataStoreClient.py @@ -19,42 +19,12 @@ from DIRAC.AccountingSystem.Client.DataStoreClient import gDataStoreClient from DIRAC.AccountingSystem.Client.Types.DataOperation import DataOperation from DIRAC.AccountingSystem.Client.Types.StorageOccupancy import StorageOccupancy +from DIRAC.tests.Utilities.Accounting import createDataOperationAccountingRecord +from DIRAC.tests.Utilities.Accounting import createStorageOccupancyAccountingRecord gLogger.setLevel('DEBUG') -def createDataOperationAccountingRecord(): - accountingDict = {} - accountingDict['OperationType'] = 'putAndRegister' - accountingDict['User'] = 'system' - accountingDict['Protocol'] = 'DataManager' - accountingDict['RegistrationTime'] = 0.0 - accountingDict['RegistrationOK'] = 0 - accountingDict['RegistrationTotal'] = 0 - accountingDict['Destination'] = 'se' - accountingDict['TransferTotal'] = 1 - accountingDict['TransferOK'] = 1 - accountingDict['TransferSize'] = 1 - accountingDict['TransferTime'] = 0.0 - accountingDict['FinalStatus'] = 'Successful' - accountingDict['Source'] = 'testSite' - oDataOperation = DataOperation() - oDataOperation.setValuesFromDict(accountingDict) - return oDataOperation - - -def createStorageOccupancyAccountingRecord(): - accountingDict = {} - accountingDict['Site'] = 'LCG.PIPPO.it' - accountingDict['Endpoint'] = 'somewhere.in.topolinea.it' - accountingDict['StorageElement'] = 'PIPPO-SE' - accountingDict['SpaceType'] = 'Total' - accountingDict['Space'] = 123456 - oSO = StorageOccupancy() - oSO.setValuesFromDict(accountingDict) - return oSO - - def test_addAndRemoveDataperation(): # just inserting one record diff --git a/tests/Integration/AccountingSystem/Test_Plots.py b/tests/Integration/AccountingSystem/Test_Plots.py index 9cffa4e7b6c..6ac89dc0cd8 100644 --- a/tests/Integration/AccountingSystem/Test_Plots.py +++ b/tests/Integration/AccountingSystem/Test_Plots.py @@ -12,38 +12,15 @@ import operator from functools import reduce -from PIL import Image # sut from DIRAC.Core.Utilities.Plotting.Plots import generateHistogram, generateStackedLinePlot, \ generatePiePlot, generateCumulativePlot, generateQualityPlot, generateTimedStackedBarPlot, \ generateNoDataPlot, generateErrorMessagePlot -plots_directory = os.path.join(os.path.dirname(__file__), 'plots') - - -def compare(file1Path, file2Path): - """ - Function used to compare two plots - returns 0.0 if both are identical - - :param str file1Path: Path to the file1. - :param str file2Path: Path to the file2. - - :return: float value rms. - """ - - # Crops image to remove the "Generated on xxxx UTC" string - image1 = Image.open(file1Path).crop((0, 0, 800, 570)) - image2 = Image.open(file2Path).crop((0, 0, 800, 570)) - - h1 = image1.histogram() - h2 = image2.histogram() - rms = math.sqrt(reduce(operator.add, - map(lambda a, b: (a - b) ** 2, h1, h2)) / len(h1)) - return rms - +from DIRAC.tests.Utilities.plots import compare +plots_directory = os.path.join(os.path.dirname(__file__), 'plots') filename = "plot.png" diff --git a/tests/Integration/AccountingSystem/Test_ReportsClient.py b/tests/Integration/AccountingSystem/Test_ReportsClient.py index e348d78c1e1..bd61559d61e 100644 --- a/tests/Integration/AccountingSystem/Test_ReportsClient.py +++ b/tests/Integration/AccountingSystem/Test_ReportsClient.py @@ -23,8 +23,8 @@ from DIRAC.AccountingSystem.Client.ReportsClient import ReportsClient from DIRAC.AccountingSystem.Client.Types.DataOperation import DataOperation -from DIRAC.tests.Integration.AccountingSystem.Test_DataStoreClient import createDataOperationAccountingRecord,\ - createStorageOccupancyAccountingRecord +from DIRAC.tests.Utilities.Accounting import createDataOperationAccountingRecord +from DIRAC.tests.Utilities.Accounting import createStorageOccupancyAccountingRecord gLogger.setLevel('DEBUG') diff --git a/tests/Integration/Monitoring/Test_Plotter.py b/tests/Integration/Monitoring/Test_Plotter.py index 61131584346..5bb23213c7d 100644 --- a/tests/Integration/Monitoring/Test_Plotter.py +++ b/tests/Integration/Monitoring/Test_Plotter.py @@ -10,7 +10,7 @@ import os -from DIRAC.tests.Integration.AccountingSystem.Test_Plots import compare +from DIRAC.tests.Utilities.plots import compare # sut from DIRAC.MonitoringSystem.private.Plotters.ComponentMonitoringPlotter import ComponentMonitoringPlotter diff --git a/tests/Integration/WorkloadManagementSystem/Test_Client_WMS.py b/tests/Integration/WorkloadManagementSystem/Test_Client_WMS.py index ec58301fe61..6f87c8e9016 100644 --- a/tests/Integration/WorkloadManagementSystem/Test_Client_WMS.py +++ b/tests/Integration/WorkloadManagementSystem/Test_Client_WMS.py @@ -39,6 +39,7 @@ parseCommandLine() from DIRAC.tests.Utilities.utils import find_all +from DIRAC.tests.Utilities.WMS import helloWorldJob, parametricJob, createFile from DIRAC import gLogger from DIRAC.Interfaces.API.Job import Job @@ -51,34 +52,6 @@ from DIRAC.WorkloadManagementSystem.DB.TaskQueueDB import TaskQueueDB -def helloWorldJob(): - job = Job() - job.setName("helloWorld") - exeScriptLocation = find_all('exe-script.py', '..', '/DIRAC/tests/Integration')[0] - job.setInputSandbox(exeScriptLocation) - job.setExecutable(exeScriptLocation, "", "helloWorld.log") - return job - - -def parametricJob(): - job = Job() - job.setName("parametric_helloWorld_%n") - exeScriptLocation = find_all('exe-script.py', '..', '/DIRAC/tests/Integration')[0] - job.setInputSandbox(exeScriptLocation) - job.setParameterSequence("args", ['one', 'two', 'three']) - job.setParameterSequence("iargs", [1, 2, 3]) - job.setExecutable(exeScriptLocation, arguments=": testing %(args)s %(iargs)s", logFile='helloWorld_%n.log') - return job - - -def createFile(job): - tmpdir = tempfile.mkdtemp() - jobDescription = tmpdir + '/jobDescription.xml' - with open(jobDescription, 'w') as fd: - fd.write(job._toXML()) - return jobDescription - - class TestWMSTestCase(unittest.TestCase): def setUp(self): diff --git a/tests/Integration/WorkloadManagementSystem/Test_GenerateAndExecutePilotWrapper.py b/tests/Integration/WorkloadManagementSystem/Test_GenerateAndExecutePilotWrapper.py index e94b2110d1d..6e63d23103b 100644 --- a/tests/Integration/WorkloadManagementSystem/Test_GenerateAndExecutePilotWrapper.py +++ b/tests/Integration/WorkloadManagementSystem/Test_GenerateAndExecutePilotWrapper.py @@ -49,7 +49,7 @@ di = url_library_urlopen(sys.argv[2], context=context) except IndexError: - di_loc = 'https://raw.githubusercontent.com/DIRACGrid/DIRAC/integration/Core/scripts/dirac-install.py' + di_loc = 'https://raw.githubusercontent.com/DIRACGrid/DIRAC/integration/src/DIRAC/Core/scripts/dirac-install.py' di = url_library_urlopen(di_loc, context=context) else: @@ -57,7 +57,7 @@ try: # dirac-install.py location from the args, if provided di = url_library_urlopen(sys.argv[2]) except IndexError: - di_loc = 'https://raw.githubusercontent.com/DIRACGrid/DIRAC/integration/Core/scripts/dirac-install.py' + di_loc = 'https://raw.githubusercontent.com/DIRACGrid/DIRAC/integration/src/DIRAC/Core/scripts/dirac-install.py' di = url_library_urlopen(di_loc) with open('PilotWrapper.py', 'wb') as pj: diff --git a/tests/Integration/WorkloadManagementSystem/Test_JobParameters_MySQLandES.py b/tests/Integration/WorkloadManagementSystem/Test_JobParameters_MySQLandES.py index 02385215bc2..d323b1cac75 100644 --- a/tests/Integration/WorkloadManagementSystem/Test_JobParameters_MySQLandES.py +++ b/tests/Integration/WorkloadManagementSystem/Test_JobParameters_MySQLandES.py @@ -21,7 +21,7 @@ from DIRAC.WorkloadManagementSystem.Client.JobMonitoringClient import JobMonitoringClient from DIRAC.WorkloadManagementSystem.Client.JobStateUpdateClient import JobStateUpdateClient -from DIRAC.tests.Integration.WorkloadManagementSystem.Test_Client_WMS import helloWorldJob, createFile +from DIRAC.tests.Utilities.WMS import helloWorldJob, createFile jobMonitoringClient = JobMonitoringClient() jobStateUpdateClient = JobStateUpdateClient() diff --git a/tests/Jenkins/utilities.sh b/tests/Jenkins/utilities.sh index 815dabf04b7..8e1bca3218f 100644 --- a/tests/Jenkins/utilities.sh +++ b/tests/Jenkins/utilities.sh @@ -316,7 +316,7 @@ installDIRAC() { exit 1 fi - cp "${TESTCODE}/DIRAC/Core/scripts/dirac-install.py" "${CLIENTINSTALLDIR}/dirac-install" + cp "${TESTCODE}/DIRAC/src/DIRAC/Core/scripts/dirac-install.py" "${CLIENTINSTALLDIR}/dirac-install" chmod +x "${CLIENTINSTALLDIR}/dirac-install" if [[ -n "${DEBUG+x}" ]]; then @@ -443,7 +443,7 @@ prepareForServer() { echo '==> [prepareForServer]' #get the necessary scripts: dirac-install.py file - cp "${TESTCODE}/DIRAC/Core/scripts/dirac-install.py" "${SERVERINSTALLDIR}/" + cp "${TESTCODE}/DIRAC/src/DIRAC/Core/scripts/dirac-install.py" "${SERVERINSTALLDIR}/" chmod +x "${SERVERINSTALLDIR}/dirac-install.py" } diff --git a/tests/py3CheckDirs.txt b/tests/py3CheckDirs.txt index f1fd71bdd22..2c872f3af71 100644 --- a/tests/py3CheckDirs.txt +++ b/tests/py3CheckDirs.txt @@ -1,20 +1,20 @@ -ConfigurationSystem/Client/ConfigurationClient.py -ConfigurationSystem/Client/CSAPI.py -ConfigurationSystem/private/Refresher.py -ConfigurationSystem/private/ServiceInterfaceBase.py -ConfigurationSystem/private/ServiceInterface.py -ConfigurationSystem/private/ServiceInterfaceTornado.py -ConfigurationSystem/Service/TornadoConfigurationHandler.py -Core/Base/Client.py -Core/DISET/private/BaseClient.py -Core/DISET/private/Service.py -Core/DISET/RequestHandler.py -Core/Security/m2crypto/X509Chain.py -Core/Tornado -DataManagementSystem/Service/TornadoFileCatalogHandler.py -FrameworkSystem/Client/ComponentInstaller.py -FrameworkSystem/Client/MonitoringClientIOLoop.py -FrameworkSystem/Client/MonitoringClient.py -FrameworkSystem/scripts/dirac-install-tornado-service.py -Resources/Catalog/FileCatalogClient.py -Resources/Storage/GFAL2_StorageBase.py +src/DIRAC/ConfigurationSystem/Client/ConfigurationClient.py +src/DIRAC/ConfigurationSystem/Client/CSAPI.py +src/DIRAC/ConfigurationSystem/private/Refresher.py +src/DIRAC/ConfigurationSystem/private/ServiceInterfaceBase.py +src/DIRAC/ConfigurationSystem/private/ServiceInterface.py +src/DIRAC/ConfigurationSystem/private/ServiceInterfaceTornado.py +src/DIRAC/ConfigurationSystem/Service/TornadoConfigurationHandler.py +src/DIRAC/Core/Base/Client.py +src/DIRAC/Core/DISET/private/BaseClient.py +src/DIRAC/Core/DISET/private/Service.py +src/DIRAC/Core/DISET/RequestHandler.py +src/DIRAC/Core/Security/m2crypto/X509Chain.py +src/DIRAC/Core/Tornado +src/DIRAC/DataManagementSystem/Service/TornadoFileCatalogHandler.py +src/DIRAC/FrameworkSystem/Client/ComponentInstaller.py +src/DIRAC/FrameworkSystem/Client/MonitoringClientIOLoop.py +src/DIRAC/FrameworkSystem/Client/MonitoringClient.py +src/DIRAC/FrameworkSystem/scripts/dirac-install-tornado-service.py +src/DIRAC/Resources/Catalog/FileCatalogClient.py +src/DIRAC/Resources/Storage/GFAL2_StorageBase.py diff --git a/virtualmachine/Vagrantfile b/virtualmachine/Vagrantfile index 2a5516ae3cf..9f62f1dc9cc 100644 --- a/virtualmachine/Vagrantfile +++ b/virtualmachine/Vagrantfile @@ -85,7 +85,7 @@ Vagrant.configure("2") do |config| # ln -s /home/vagrant/etc /home/vagrant/hostcode/etc # # Installing DIRAC in /opt/dirac - # curl -L -o dirac-install https://raw.githubusercontent.com/DIRACGrid/DIRAC/integration/Core/scripts/dirac-install.py && \ + # curl -L -o dirac-install https://raw.githubusercontent.com/DIRACGrid/DIRAC/integration/src/DIRAC/Core/scripts/dirac-install.py && \ # chmod +x dirac-install && \ # ./dirac-install -r $DIRAC_VERSION -t client && \ # rm dirac-install && \