Skip to content

Validate v7r2 pre39#5032

Merged
atsareg merged 14 commits into
DIRACGrid:integrationfrom
atsareg:validate-v7r2-pre39
Mar 16, 2021
Merged

Validate v7r2 pre39#5032
atsareg merged 14 commits into
DIRACGrid:integrationfrom
atsareg:validate-v7r2-pre39

Conversation

@atsareg

@atsareg atsareg commented Mar 12, 2021

Copy link
Copy Markdown
Contributor

No description provided.

@chrisburr

Copy link
Copy Markdown
Member

The warning in the docs is:

/home/docs/checkouts/readthedocs.org/user_builds/dirac/checkouts/5032/docs/source/AdministratorGuide/Resources/storage.rst:313: WARNING: undefined label: dirac-dms-protocol-matrix

from DIRAC.Core.Base import Script
from DIRAC.Core.Utilities.DIRACScript import DIRACScript

Script.registerSwitch('', 'FromSE=', 'SE1[,SE2,...]')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need to be inside main

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Script.setUsageMessage(... should also go inside main ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or it can be simply scrapped ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything with Script.xxxx must go inside main. Actually I think the Script stuff is broken again as from DIRAC.Core.Base import Script is setting it globally...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see other scripts where import Script is outside main()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The doc build is successful. Should the script be still fixed to bring everything inside main ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs are still wrong when you call --help (see below). The issue is from #4958:

doc = inspect.currentframe().f_back.f_globals['__doc__']
caller = inspect.currentframe().f_back.f_globals['__name__']

Examples:

$ dirac-info --help

Core implementation of import.

This module is NOT meant to be directly imported! It has been designed such
that it can be bootstrapped into Python as the implementation of import. As
such it requires the injection of specific modules and attributes in order to
work. One should use importlib as the public-facing version of this module.


Usage:

  dirac-info [options] ...

General options:
  -o  --option <value>         : Option=value to add
  -s  --section <value>        : Set base section for relative parsed options
  -c  --cert <value>           : Use server certificate to connect to Core Services
  -d  --debug                  : Set debug mode (-ddd is extra debug)
  -   --cfg=                   : Load additional config file
  -   --autoreload             : Automatically restart if there's any change in the module
  -   --license                : Show DIRAC's LICENSE
  -h  --help                   : Shows this help

Options:
  -v  --version                : print version of current DIRAC installation
  -p  --platform               : print platform of current DIRAC installation
$ dirac-proxy-info --help

Core implementation of import.

This module is NOT meant to be directly imported! It has been designed such
that it can be bootstrapped into Python as the implementation of import. As
such it requires the injection of specific modules and attributes in order to
work. One should use importlib as the public-facing version of this module.


Usage:

  dirac-proxy-info [options] ...

General options:
  -o  --option <value>         : Option=value to add
  -s  --section <value>        : Set base section for relative parsed options
  -c  --cert <value>           : Use server certificate to connect to Core Services
  -d  --debug                  : Set debug mode (-ddd is extra debug)
  -   --cfg=                   : Load additional config file
  -   --autoreload             : Automatically restart if there's any change in the module
  -   --license                : Show DIRAC's LICENSE
  -h  --help                   : Shows this help

Options:
  -f  --file <value>           : File to use as user key
  -i  --version                : Print version
  -n  --novoms                 : Disable VOMS
  -v  --checkvalid             : Return error if the proxy is invalid
  -x  --nocs                   : Disable CS
  -e  --steps                  : Show steps info
  -j  --noclockcheck           : Disable checking if time is ok
  -m  --uploadedinfo           : Show uploaded proxies info

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you look in the readthedocs all scripts have the same description: https://dirac--5032.org.readthedocs.build/en/5032/UserGuide/CommandReference/WorkloadManagement/index.html

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll take a look

@atsareg atsareg Mar 12, 2021

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the __doc__ strings are not added to the command descriptions if there is no setUsageMessage() call

Comment on lines +51 to +53
Script.setUsageMessage('\n'.join([__doc__,
'Usage:',
' %s [option|cfgfile] % Script.scriptName']))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With #4958 there is no need for that

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I have scrapped it

@atsareg atsareg merged commit 91eb041 into DIRACGrid:integration Mar 16, 2021
@atsareg atsareg deleted the validate-v7r2-pre39 branch June 8, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants