Classes | |
class | CERNSSOError |
class | DropBox |
class | HTTP |
class | HTTPError |
Functions | |
def | _getCERNSSOCookies |
def | addToTarFile |
def | getInput |
def | getInputChoose |
def | getInputRepeat |
def | getInputWorkflow |
Variables | |
string | __author__ = 'Miguel Ojeda' |
string | __copyright__ = 'Copyright 2012, CERN CMS' |
list | __credits__ = ['Giacomo Govi', 'Salvatore Di Guida', 'Miguel Ojeda', 'Andreas Pfeiffer'] |
string | __email__ = 'mojedasa@cern.ch' |
string | __license__ = 'Unknown' |
string | __maintainer__ = 'Miguel Ojeda' |
int | __version__ = 6 |
string | defaultBackend = 'online' |
string | defaultHostname = 'cms-conddb-prod.cern.ch' |
string | defaultNetrcHost = 'DropBox' |
string | defaultTemporaryFile = 'upload.tar.bz2' |
string | defaultUrlTemplate = 'https://%s/dropBox/' |
string | defaultWorkflow = 'offline' |
Returns the required CERN SSO cookies for a URL using Kerberos. They can be used with any HTTP client (libcurl, wget, urllib...). If you wish to make secure SSL connections to the CERN SSO (i.e. verify peers/hosts), you may need to install the CERN-CA-certs package. Use secure == False to skip this (i.e. this is the same as curl -k/--insecure). Not recommended: tell users to install them or use lxplus6. The same way, if you have a self-signed certificate in your target URL you can use secureTarget == False as well. Note that this option is provided in order to be able to use a secure SSL connection to CERN SSO, even if the connection to your target URL is not secure. Note that you will probably need the CERN-CA-certs package after you get a certificate signed by the CERN CA (https://cern.ch/ca), even if you did not need it for the CERN SSO. Note that this method *does* a query to the given URL if successful. This was implemented outside the HTTP class for two main reasons: * The only thing needed to use CERN SSO is the cookies, therefore this function is useful alone as well (e.g. as a simple replacement of the cern-get-sso-cookie script or as a Python port of the WWW::CERNSSO::Auth Perl package -- this one does not write any file and can be used in-memory, by the way). * We do not need to use the curl handler of the HTTP class. This way we do not overwrite any options in that one and we use only a temporary one here for getting the cookie. TODO: Support also Certificate/Key authentication. TODO: Support also Username/Password authentication. TODO: Review the error paths. TODO: Why PERLSESSID was used in the original code? TODO: Retry if timeouts are really common (?)
Definition at line 53 of file upload_popcon.py.
Referenced by upload_popcon.HTTP.addCERNSSOCookies().
def upload_popcon.addToTarFile | ( | tarFile, | |
fileobj, | |||
arcname | |||
) |
def upload_popcon.getInput | ( | default, | |
prompt = '' |
|||
) |
Like raw_input() but with a default and automatic strip().
Definition at line 550 of file upload_popcon.py.
Referenced by getInputChoose(), and getInputWorkflow().
def upload_popcon.getInputChoose | ( | optionsList, | |
default, | |||
prompt = '' |
|||
) |
Makes the user choose from a list of options.
Definition at line 574 of file upload_popcon.py.
References getInput().
def upload_popcon.getInputRepeat | ( | prompt = '' | ) |
Like raw_input() but repeats if nothing is provided and automatic strip().
Definition at line 589 of file upload_popcon.py.
def upload_popcon.getInputWorkflow | ( | prompt = '' | ) |
Like getInput() but tailored to get target workflows (synchronization options).
Definition at line 561 of file upload_popcon.py.
References getInput().
string upload_popcon.__author__ = 'Miguel Ojeda' |
Definition at line 5 of file upload_popcon.py.
string upload_popcon.__copyright__ = 'Copyright 2012, CERN CMS' |
Definition at line 6 of file upload_popcon.py.
list upload_popcon.__credits__ = ['Giacomo Govi', 'Salvatore Di Guida', 'Miguel Ojeda', 'Andreas Pfeiffer'] |
Definition at line 7 of file upload_popcon.py.
string upload_popcon.__email__ = 'mojedasa@cern.ch' |
Definition at line 10 of file upload_popcon.py.
string upload_popcon.__license__ = 'Unknown' |
Definition at line 8 of file upload_popcon.py.
string upload_popcon.__maintainer__ = 'Miguel Ojeda' |
Definition at line 9 of file upload_popcon.py.
int upload_popcon.__version__ = 6 |
Definition at line 11 of file upload_popcon.py.
string upload_popcon.defaultBackend = 'online' |
Definition at line 28 of file upload_popcon.py.
string upload_popcon.defaultHostname = 'cms-conddb-prod.cern.ch' |
Definition at line 29 of file upload_popcon.py.
string upload_popcon.defaultNetrcHost = 'DropBox' |
Definition at line 32 of file upload_popcon.py.
string upload_popcon.defaultTemporaryFile = 'upload.tar.bz2' |
Definition at line 31 of file upload_popcon.py.
string upload_popcon.defaultUrlTemplate = 'https://%s/dropBox/' |
Definition at line 30 of file upload_popcon.py.
string upload_popcon.defaultWorkflow = 'offline' |
Definition at line 33 of file upload_popcon.py.