Classes | |
class | ConditionsUploader |
class | HTTP |
class | HTTPError |
Functions | |
def | addToTarFile (tarFile, fileobj, arcname) |
def | get_directory_to_pull_to (default_directory, commit_hash) |
def | get_local_commit_hash () |
def | get_version_info (url) |
def | getCredentials (options) |
def | getInput (default, prompt='') |
def | getInputChoose (optionsList, default, prompt='') |
def | getInputRepeat (prompt='') |
def | getInputWorkflow (prompt='') |
def | main () |
def | parse_arguments () |
def | pull_code_from_git (target_directory, repository_url, hash) |
def | re_upload (options) |
def | run_in_shell (popenargs, kwargs) |
def | run_upload (parameters) |
def | runWizard (basename, dataFilename, metadataFilename) |
def | testTier0Upload () |
def | upload (options, arguments) |
def | uploadAllFiles (options, arguments) |
def | uploadTier0Files (filenames, username, password, cookieFileName=None) |
Joshua Dawes - CERN, CMS - The University of Manchester Upload script wrapper - controls the automatic update system. Note: the name of the file follows a different convention to the others because it should be the same as the current upload script name. Takes user arguments and passes them to the main upload module CondDBFW.uploads, once the correct version exists. 1. Ask the server corresponding to the database we're uploading to which version of CondDBFW it has (query the /conddbfw_version/ url). 2. Decide which directory that we can write to - either the current local directory, or /tmp/random_string/. 3. Pull the commit returned from the server into the directory from step 2. 4. Invoke the CondDBFW.uploads module with the arguments given to this script.
Script that uploads to the new CMS conditions uploader. Adapted to the new infrastructure from v6 of the upload.py script for the DropBox from Miguel Ojeda.
def uploadConditions.addToTarFile | ( | tarFile, | |
fileobj, | |||
arcname | |||
) |
Definition at line 439 of file uploadConditions.py.
Referenced by uploadConditions.ConditionsUploader.uploadFile().
def uploadConditions.get_directory_to_pull_to | ( | default_directory, | |
commit_hash | |||
) |
Finds out which directory we can safely use - either CondDBFW/ or a temporary directory.
Definition at line 73 of file uploadConditions.py.
References cmsRelvalreport.exit.
Referenced by parse_arguments().
def uploadConditions.get_local_commit_hash | ( | ) |
Gets the commit hash used by the local repository CondDBFW/.git/.
Definition at line 50 of file uploadConditions.py.
References cmsRelvalreport.exit, edm.print(), and digitizers_cfi.strip.
Referenced by parse_arguments().
def uploadConditions.get_version_info | ( | url | ) |
Queries the server-side for the commit hash it is currently using. Note: this is the commit hash used by /data/services/common/CondDBFW on the server-side.
Definition at line 32 of file uploadConditions.py.
Referenced by parse_arguments().
def uploadConditions.getCredentials | ( | options | ) |
Definition at line 627 of file uploadConditions.py.
References getInput().
Referenced by uploadAllFiles().
def uploadConditions.getInput | ( | default, | |
prompt = '' |
|||
) |
Like raw_input() but with a default and automatic strip().
Definition at line 52 of file uploadConditions.py.
Referenced by getCredentials(), getInputChoose(), getInputWorkflow(), runWizard(), and uploadAllFiles().
def uploadConditions.getInputChoose | ( | optionsList, | |
default, | |||
prompt = '' |
|||
) |
Makes the user choose from a list of options.
Definition at line 76 of file uploadConditions.py.
References getInput(), and createfilelist.int.
Referenced by runWizard().
def uploadConditions.getInputRepeat | ( | prompt = '' | ) |
Like raw_input() but repeats if nothing is provided and automatic strip().
Definition at line 91 of file uploadConditions.py.
Referenced by runWizard().
def uploadConditions.getInputWorkflow | ( | prompt = '' | ) |
Like getInput() but tailored to get target workflows (synchronization options).
Definition at line 63 of file uploadConditions.py.
References getInput().
def uploadConditions.main | ( | ) |
Entry point.
Definition at line 897 of file uploadConditions.py.
References edm.print(), re_upload(), and upload().
def uploadConditions.parse_arguments | ( | ) |
Definition at line 179 of file uploadConditions.py.
References cmsRelvalreport.exit, get_directory_to_pull_to(), get_local_commit_hash(), get_version_info(), join(), data_sources.json_data_node.make(), edm.print(), pull_code_from_git(), run_in_shell(), run_upload(), and str.
Referenced by uploads.uploader.send_metadata().
def uploadConditions.pull_code_from_git | ( | target_directory, | |
repository_url, | |||
hash | |||
) |
Pulls CondDBFW from the git repository specified by the upload server.
Definition at line 98 of file uploadConditions.py.
References edm.print(), run_in_shell(), and str.
Referenced by parse_arguments().
def uploadConditions.re_upload | ( | options | ) |
Definition at line 812 of file uploadConditions.py.
References edm.decode(), edm.print(), str, and upload().
Referenced by main().
def uploadConditions.run_in_shell | ( | popenargs, | |
kwargs | |||
) |
Runs string-based commands in the shell and returns the result.
Definition at line 147 of file uploadConditions.py.
Referenced by parse_arguments(), and pull_code_from_git().
def uploadConditions.run_upload | ( | parameters | ) |
Imports CondDBFW.uploads and runs the upload with the upload metadata obtained.
Definition at line 165 of file uploadConditions.py.
References cmsRelvalreport.exit.
Referenced by parse_arguments().
def uploadConditions.runWizard | ( | basename, | |
dataFilename, | |||
metadataFilename | |||
) |
Definition at line 103 of file uploadConditions.py.
References getInput(), getInputChoose(), getInputRepeat(), createfilelist.int, edm.print(), and ComparisonHelper.zip().
Referenced by uploadAllFiles().
def uploadConditions.testTier0Upload | ( | ) |
Definition at line 976 of file uploadConditions.py.
References uploadTier0Files().
def uploadConditions.upload | ( | options, | |
arguments | |||
) |
Definition at line 886 of file uploadConditions.py.
References edm.print(), and uploadAllFiles().
Referenced by main(), and re_upload().
def uploadConditions.uploadAllFiles | ( | options, | |
arguments | |||
) |
Definition at line 657 of file uploadConditions.py.
References getCredentials(), getInput(), runWizard(), and str.
Referenced by upload().
Uploads a bunch of files coming from Tier0. This has the following requirements: * Username/Password based authentication. * Uses the online backend. * Ignores errors related to the upload/content (e.g. duplicated file).
Definition at line 775 of file uploadConditions.py.
Referenced by testTier0Upload().