Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 11 additions & 15 deletions src/DIRAC/ConfigurationSystem/scripts/dirac_admin_add_site.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,6 @@
Add a new DIRAC SiteName to DIRAC Configuration, including one or more CEs.
If site is already in the CS with another name, error message will be produced.
If site is already in the CS with the right name, only new CEs will be added.

Usage:

dirac-admin-add-site [option|cfgfile] ... DIRACSiteName GridSiteName CE [CE] ...

Arguments:

DIRACSiteName: Name of the site for DIRAC in the form GRID.LOCATION.COUNTRY (ie:LCG.CERN.ch)
GridSiteName: Name of the site in the Grid (ie: CERN-PROD)
CE: Name of the CE to be included in the site (ie: ce111.cern.ch)

Example:

$ dirac-admin-add-site LCG.IN2P3.fr IN2P3-Site
"""
from __future__ import absolute_import
from __future__ import division
Expand All @@ -36,7 +22,17 @@

@DIRACScript()
def main():
Script.setUsageMessage(__doc__)
Script.setUsageMessage(
'\n'.join(
[
__doc__.split('\n')[1],
'Usage:',
' %s [option|cfgfile] ... DIRACSiteName GridSiteName CE [CE] ...' %
Script.scriptName,
'Arguments:',
' DIRACSiteName: Name of the site for DIRAC in the form GRID.LOCATION.COUNTRY (ie:LCG.CERN.ch)',
' GridSiteName: Name of the site in the Grid (ie: CERN-PROD)',
' CE: Name of the CE to be included in the site (ie: ce111.cern.ch)']))
Script.parseCommandLine(ignoreErrors=True)
args = Script.getPositionalArgs()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

__RCSID__ = "$Id$"

from DIRAC import gLogger, exit as DIRACExit
Expand Down
29 changes: 15 additions & 14 deletions src/DIRAC/Core/scripts/dirac_install_extension.py
Original file line number Diff line number Diff line change
@@ -1,36 +1,37 @@
#!/usr/bin/env python
"""
Allows to add a specified extension to an already existing DIRAC installation.
The extension can come from another project than the one installed.
No new version directory is created. The command is based on the main DIRAC installer dirac-install.py.

Usage::
""" dirac-install-extension command allows to add a specified extension
to an already existing DIRAC installation. No new version directory is created.
The command is based on the main DIRAC installer dirac-install.py.

dirac-install-extension (<options>|<cfgFile>)*
The valid options are:

-l <project> - the project in which the extension is developed
-r <release> - the project release version
-e <extension> - the extension name. Several -e options can be given
"""

from __future__ import unicode_literals, absolute_import, division, print_function

import os
import sys
import six
import time
import getopt
import importlib
import getopt
import time
import six

cmdOpts = (('r:', 'release=', 'Release version to install'),
('l:', 'project=', 'Project to install'),
('e:', 'extensions=', 'Extensions to install (comma separated). Several -e options can be given'),
('M:', 'defaultsURL=', 'Where to retrieve the global defaults from'),
('e:', 'extensions=', 'Extensions to install (comma separated)'),
('h', 'help', 'help doc string'))


def usage():
""" Usage printout
"""
print(__doc__)
print('Options::\n\n')
print("\nThe command allows to add a specified extension to an already existing DIRAC installation.\n"
"The extension can come from another project than the one installed.")
print("\nUsage:\n\n %s <opts> <cfgFile>" % 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]))

Expand Down
32 changes: 0 additions & 32 deletions src/DIRAC/Core/scripts/dirac_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,12 @@
# File : dirac-platform
# Author : Adria Casajus
########################################################################
"""
The *dirac-platform* script determines the "platform" of a certain node.
The platform is a string used to identify the minimal characteristics of the node,
enough to determine which version of DIRAC can be installed.

Invoked at any installation, so by the *dirac-install* script, and by the pilots.

On a RHEL 6 node, for example, the determined dirac platform is "Linux_x86_64_glibc-2.5"

Usage::

dirac-platform [option|cfgfile]

Example::

$ dirac-platform
Linux_x86_64_glibc-2.5

"""
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division

__RCSID__ = "$Id$"

import sys
import getopt

cmdOpt = ('h', 'help', 'help doc string')

optList, args = getopt.getopt(sys.argv[1:], cmdOpt[0], cmdOpt[1])
for opt, value in optList:
if opt in ('-h', '--help'):
print(__doc__)
print('Options::\n\n')
print(" %s %s : %s" % (cmdOpt[0].ljust(3), cmdOpt[1].ljust(20), cmdOpt[2]))
sys.exit(0)

try:
from DIRAC.Core.Utilities.Platform import getPlatformString
except Exception:
Expand Down
26 changes: 1 addition & 25 deletions src/DIRAC/Core/scripts/dirac_version.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,12 @@
# Author : Ricardo Graciani
########################################################################
"""
Print version of current DIRAC installation

Usage::

dirac-version [option]

Example::

$ dirac-version

print version of current DIRAC installation
"""
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division

__RCSID__ = "$Id$"

import sys
import getopt

cmdOpt = ('h', 'help', 'help doc string')

optList, args = getopt.getopt(sys.argv[1:], cmdOpt[0], cmdOpt[1])
for opt, value in optList:
if opt in ('-h', '--help'):
print(__doc__)
print('Options::\n\n')
print(" %s %s : %s" % (cmdOpt[0].ljust(3), cmdOpt[1].ljust(20), cmdOpt[2]))
sys.exit(0)

import DIRAC
from DIRAC.Core.Utilities.DIRACScript import DIRACScript

Expand Down
10 changes: 0 additions & 10 deletions src/DIRAC/FrameworkSystem/scripts/dirac_admin_proxy_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,16 @@
# File : dirac-admin-proxy-upload.py
# Author : Adrian Casajus
########################################################################
"""
Usage:

dirac-admin-proxy-upload.py (<options>|<cfgFile>)*

Example::

$ dirac-admin-proxy-upload
"""
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division

import sys
from DIRAC.Core.Base import Script
from DIRAC.Core.Utilities.DIRACScript import DIRACScript
from DIRAC.FrameworkSystem.Client.ProxyUpload import CLIParams, uploadProxy

__RCSID__ = "$Id$"
Script.setUsageMessage(__doc__)


@DIRACScript()
Expand Down
5 changes: 3 additions & 2 deletions src/DIRAC/FrameworkSystem/scripts/dirac_proxy_destroy.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@

import DIRAC
from DIRAC import gLogger, S_OK
from DIRAC.Core.Security import Locations
from DIRAC.Core.Base import Script
from DIRAC.Core.Utilities.DIRACScript import DIRACScript

from DIRAC.Core.Security import Locations, ProxyInfo
from DIRAC.Core.DISET.RPCClient import RPCClient
from DIRAC.FrameworkSystem.Client.ProxyManagerClient import gProxyManager
from DIRAC.Core.Security import ProxyInfo
from DIRAC.ConfigurationSystem.Client.Helpers import Registry

__RCSID__ = "$Id$"
Expand Down Expand Up @@ -59,7 +60,7 @@ def registerCLISwitches(self):
"""
add options to dirac option parser
"""
Script.setUsageMessage(__doc__)
Script.setUsageMessage("Script to delete a dirac proxy. Default: delete local proxy only.")
Script.registerSwitch(
"a",
"all",
Expand Down
12 changes: 1 addition & 11 deletions src/DIRAC/FrameworkSystem/scripts/dirac_proxy_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,6 @@
# File : dirac-proxy-init.py
# Author : Adrian Casajus
########################################################################
"""
Usage:

dirac-proxy-init.py (<options>|<cfgFile>)*

Example:

$ dirac-proxy-init -g dirac_user -t --rfc
Enter Certificate password:
"""
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
Expand All @@ -34,7 +24,7 @@
from DIRAC.FrameworkSystem.Client.BundleDeliveryClient import BundleDeliveryClient

__RCSID__ = "$Id$"
Script.setUsageMessage(__doc__)


class Params(ProxyGeneration.CLIParams):

Expand Down
2 changes: 1 addition & 1 deletion tests/System/transformationSystem.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ stamptime=$(date +%Y%m%d_%H%M%S)
stime=$(date +"%H%M%S")
tdate=$(date +"20%y-%m-%d")
ttime=$(date +"%R")
version=$(dirac-info -v)
version=$(dirac-version)

if [[ -d "TransformationSystemTest" ]]; then
echo "Removing TransformationSystemTest"
Expand Down
2 changes: 1 addition & 1 deletion tests/System/transformation_replication.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ echo " "
#Values to be used
stime=$(date +"%H%M%S")
tdate=$(date +"20%y-%m-%d")
version=$(dirac-info -v)
version=$(dirac-version)

if [[ -d "TransformationSystemTest" ]]; then
echo "Removing TransformationSystemTest"
Expand Down