test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions | Variables
dqmd_manager Namespace Reference

Functions

def exec_func
 
def info
 
def rpm_install
 
def rpm_update
 
def usage
 

Variables

tuple action = actions.get(sys.argv[2])
 
dictionary actions
 
string COLOR_BLUE = '\033[94m'
 
string COLOR_DEF = '\033[0m'
 
string COLOR_GREEN = '\033[92m'
 
string COLOR_PURPLE = '\033[95m'
 
string COLOR_RED = '\033[91m'
 
string COLOR_YELLOW = '\033[93m'
 
dictionary machines
 
string rpm_path = ''
 
tuple targets = machines.get(sys.argv[1])
 

Function Documentation

def dqmd_manager.exec_func (   machine,
  action 
)

Definition at line 66 of file dqmd_manager.py.

References action, cmsRelvalreport.exit, info(), and usage().

66 
67 def exec_func(machine, action):
68  info('Machine: ' + machine)
69  call_list = []
70  call_list.append('ssh')
71  call_list.append(machine)
72 
73  if hasattr(action, '__call__'):
74  call_list.append(action(machine))
75  else:
76  call_list.append(action)
77 
78  # print(call_list) # DEBUG_CODE
79  subprocess.call(call_list, stderr=subprocess.STDOUT)
80 
81  info()
82 
def dqmd_manager.info (   info = None)

Definition at line 59 of file dqmd_manager.py.

References reco.print().

Referenced by exec_func().

59 
60 def info(info=None):
61  if None != info:
62  print(COLOR_BLUE + '***************************** ' + info + ' *****************************' + COLOR_DEF)
63  else:
64  print(COLOR_BLUE + '*********************************************************************************' + COLOR_DEF)
65 
std::string print(const Track &, edm::Verbosity=edm::Concise)
Track print utility.
Definition: print.cc:10
def dqmd_manager.rpm_install (   machine)

Definition at line 19 of file dqmd_manager.py.

19 
20 def rpm_install(machine):
21  return 'sudo rpm --install {0}'.format(rpm_path)
def dqmd_manager.rpm_update (   machine)

Definition at line 22 of file dqmd_manager.py.

22 
23 def rpm_update(machine):
24  return 'sudo rpm -Uhv --force {0}'.format(rpm_path)
25 
def dqmd_manager.usage ( )

Definition at line 47 of file dqmd_manager.py.

References join(), and reco.print().

Referenced by exec_func().

47 
48 def usage():
49  print('Usage: ' + sys.argv[0] + ' MACHINES ACTIONS')
50 
51  print('\tMACHINES:')
52  for target in machines.keys():
53  print('\t\t' + target + ': ' + ', '.join(machines[target]))
54 
55  print('\tACTIONS:')
56  for action in actions.keys():
57  print('\t\t' + action)
58 
std::string print(const Track &, edm::Verbosity=edm::Concise)
Track print utility.
Definition: print.cc:10
static std::string join(char **cmd)
Definition: RemoteFile.cc:18

Variable Documentation

tuple dqmd_manager.action = actions.get(sys.argv[2])

Definition at line 93 of file dqmd_manager.py.

Referenced by exec_func().

dictionary dqmd_manager.actions
Initial value:
1 = { 'rpm_install' : rpm_install,
2  'rpm_update' : rpm_update,
3  'rpm_install_status' : 'rpm -qa hltd',
4  'rpm_remove' : 'sudo rpm --erase hltd',
5  'daemon_status' : 'sudo /sbin/service hltd status',
6  'daemon_start' : 'sudo /sbin/service hltd start',
7  'daemon_stop' : 'sudo /sbin/service hltd stop',
8  'daemon_stop-light' : 'sudo /sbin/service hltd stop-light',
9  'daemon_restart' : 'sudo /sbin/service hltd restart'}

Definition at line 36 of file dqmd_manager.py.

string dqmd_manager.COLOR_BLUE = '\033[94m'

Definition at line 9 of file dqmd_manager.py.

Referenced by cscdqm::EventProcessor.writeShifterHistograms().

string dqmd_manager.COLOR_DEF = '\033[0m'

Definition at line 13 of file dqmd_manager.py.

string dqmd_manager.COLOR_GREEN = '\033[92m'

Definition at line 10 of file dqmd_manager.py.

Referenced by cscdqm::EventProcessor.writeShifterHistograms().

string dqmd_manager.COLOR_PURPLE = '\033[95m'

Definition at line 8 of file dqmd_manager.py.

string dqmd_manager.COLOR_RED = '\033[91m'

Definition at line 12 of file dqmd_manager.py.

Referenced by cscdqm::EventProcessor.writeShifterHistograms().

string dqmd_manager.COLOR_YELLOW = '\033[93m'

Definition at line 11 of file dqmd_manager.py.

dictionary dqmd_manager.machines
Initial value:
1 = { 'bu' : ['dqm-c2d07-22', 'bu-c2f13-31-01', 'bu-c2f13-29-01'],
2  'dev' : ['dqm-c2d07-21', 'dqm-c2d07-22', 'dqm-c2d07-23', 'dqm-c2d07-24', 'dqm-c2d07-25', 'dqm-c2d07-26', 'dqm-c2d07-27'],
3  'dev_current' : ['dqm-c2d07-22', 'dqm-c2d07-23'],
4  'ed' : ['bu-c2f13-29-01', 'fu-c2f13-41-01', 'fu-c2f13-41-02', 'fu-c2f13-41-03', 'fu-c2f13-41-04'],
5  'ed_current' : ['bu-c2f13-29-01', 'fu-c2f13-41-03'],
6  'prod' : ['bu-c2f13-31-01', 'fu-c2f13-39-01', 'fu-c2f13-39-02', 'fu-c2f13-39-03', 'fu-c2f13-39-04'],
7  'prod_current' : ['bu-c2f13-31-01', 'fu-c2f13-39-04']
8  }

Definition at line 26 of file dqmd_manager.py.

string dqmd_manager.rpm_path = ''

Definition at line 17 of file dqmd_manager.py.

tuple dqmd_manager.targets = machines.get(sys.argv[1])

Definition at line 88 of file dqmd_manager.py.

Referenced by PhysicsTools::TreeTrainer.addTree(), and L1TGlobalPrescaler.filter().