Changeset 991 for dassmodus/trunk


Ignore:
Timestamp:
Apr 7, 2012, 5:44:00 PM (13 years ago)
Author:
pstorz
Message:

director ressource sorted differently

Location:
dassmodus/trunk/dassmodus/nosferatu/nosferatu
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • dassmodus/trunk/dassmodus/nosferatu/nosferatu/auto_configrules.py

    r990 r991  
    542542# It must have one item for each of the resources.
    543543dird_resources = [
     544  [ 'catalog' , 'R_CATALOG', dird_cat_items ],
     545  [ 'storage' , 'R_STORAGE', dird_store_items ],
     546  [ 'fileset' , 'R_FILESET', dird_fs_items ],
     547  [ 'pool' , 'R_POOL', dird_pool_items ],
     548  [ 'jobdefs' , 'R_JOBDEFS', dird_job_items ],
     549  [ 'client' , 'R_CLIENT', dird_cli_items ],
     550  [ 'counter' , 'R_COUNTER', dird_counter_items ],
     551  [ 'messages' , 'R_MSGS', lib_msgs_items ],
     552  [ 'job' , 'R_JOB', dird_job_items ],
     553  [ 'director' , 'R_DIRECTOR', dird_dir_items ],
    544554  [ 'console' , 'R_CONSOLE', dird_con_items ],
    545   [ 'jobdefs' , 'R_JOBDEFS', dird_job_items ],
    546555  [ 'schedule' , 'R_SCHEDULE', dird_sch_items ],
    547   [ 'messages' , 'R_MSGS', lib_msgs_items ],
    548   [ 'counter' , 'R_COUNTER', dird_counter_items ],
    549   [ 'storage' , 'R_STORAGE', dird_store_items ],
    550   [ 'catalog' , 'R_CATALOG', dird_cat_items ],
    551   [ 'fileset' , 'R_FILESET', dird_fs_items ],
    552   [ 'director' , 'R_DIRECTOR', dird_dir_items ],
    553   [ 'job' , 'R_JOB', dird_job_items ],
    554   [ 'client' , 'R_CLIENT', dird_cli_items ],
    555   [ 'pool' , 'R_POOL', dird_pool_items ],
    556556]
    557557
  • dassmodus/trunk/dassmodus/nosferatu/nosferatu/tools/generate_web2py_db_model.py

    r990 r991  
    5252
    5353
    54 
    55 
    56 def item2field(item):
     54def item2field(confshort, item):
    5755    if item.name == 'where' : # where cannot be a column name in sqlite
    5856      item.name = 'where_'
     
    6260      if item.name.endswith('pool'):
    6361        refname = 'pool'
    64       fieldtype = 'reference dird_conf__%s'  %  (refname)
     62      print '### ' + refname
     63     
     64      fieldtype = 'reference %s_conf__%s'  %  (confshort,refname)
    6565      defaultvalue = 0
    6666      return """ Field('%s','%s', default=%s), """ %(item.name, fieldtype , defaultvalue)
     
    7070      if item.type == "store_bool":
    7171        fieldtype = "boolean"
    72         print "#####%s %s %s" % (item.name, item.defaultvalue, defaultvalue)
     72        #print "#####%s %s %s" % (item.name, item.defaultvalue, defaultvalue)
    7373        return """ Field('%s','%s', default=%s), """ %(item.name, fieldtype , defaultvalue)
    7474      return """ Field('%s','%s', default='%s'), """ %(item.name, fieldtype , defaultvalue)
     
    8181dir_res_list = list()
    8282 
     83confshort = 'dird'
    8384for res in auto_configrules.dird_resources:
    8485  res_name = res[0]
     
    8889  print
    8990  #print res_name
    90   print """db.define_table('dird_conf__%s',  """ % (res_name)
    91   for item in res_items:
    92     item.required=False
    93     item.printall=True
    94     print item2field(item)
    95   print """ format='%(name)s')"""
    96 
    97 
    98 
     91  print """db.define_table('%s_conf__%s',  """ % (confshort,res_name)
     92  for item in res_items:
     93    item.required=False
     94    item.printall=True
     95    print item2field(confshort,item)
     96  print """ format='%(name)s')"""
     97
     98
     99confshort = 'stored'
    99100stor_res_list = list()
    100101for res in auto_configrules.stored_resources:
     
    105106  print
    106107  #print res_name
    107   print """db.define_table('stored_conf__%s',  """ % (res_name)
    108   for item in res_items:
    109     item.required=False
    110     item.printall=True
    111     print item2field(item)
    112   print """ format='%(name)s')"""
    113 
    114 
    115 
     108  print """db.define_table('%s_conf__%s',  """ % (confshort,res_name)
     109  for item in res_items:
     110    item.required=False
     111    item.printall=True
     112    print item2field(confshort,item)
     113  print """ format='%(name)s')"""
     114
     115
     116confshort = 'filed'
    116117filed_res_list = list()
    117118for res in auto_configrules.filed_resources:
     
    122123  print
    123124  #print res_name
    124   print """db.define_table('filed_conf__%s',  """ % (res_name)
    125   for item in res_items:
    126     item.required=False
    127     item.printall=True
    128     print item2field(item)
    129   print """ format='%(name)s')"""
    130 
    131 
    132 
    133 
    134 
    135 
    136 
    137 
    138 
    139 
    140 for res in dir_res_list:
    141 #  print """db.define_table('dird_conf__%s',
    142 #  Field('name','string'),
    143 #  format = '%%(name)s')
    144 #  """ % (res)
    145    
     125  print """db.define_table('%s_conf__%s',  """ % (confshort,res_name)
     126  for item in res_items:
     127    item.required=False
     128    item.printall=True
     129    print item2field(confshort,item)
     130  print """ format='%(name)s')"""
     131
     132confshort = 'cons'
     133cons_res_list = list()
     134for res in auto_configrules.console_resources:
     135  res_name = res[0]
     136  res_type = res[1]
     137  res_items = res[2]
     138  cons_res_list.append(res_name)
     139  print
     140  #print res_name
     141  print """db.define_table('%s_conf__%s',  """ % (confshort,res_name)
     142  for item in res_items:
     143    item.required=False
     144    item.printall=True
     145    print item2field(confshort,item)
     146  print """ format='%(name)s')"""
     147
     148
     149
     150
     151
     152for res in dir_res_list:   
    146153  print """db.define_table('dird_conf__%s_link',
    147154  Field('%s','reference dird_conf__%s'),
    148155  format = '%%(id)s')
    149156    """ % (res,res,res)
    150 
    151 
    152 
    153157print """db.define_table('dird_conf',
    154158  Field('name','string'),"""
     159
    155160for res in dir_res_list:
    156161  print "  Field('dird_conf__%s', 'reference dird_conf__%s_link')," % (res,res )
     
    160165
    161166
    162 
    163 
    164 #for item in auto_configrules.dird_cat_items:
    165 #  item.required=False
    166 #  print """
    167 #   Field('%s','reference dird_conf_catalog'),
    168 #  """
     167for res in stor_res_list:   
     168  print """db.define_table('stord_conf__%s_link',
     169  Field('%s','reference stord_conf__%s'),
     170  format = '%%(id)s')
     171    """ % (res,res,res)
     172print """db.define_table('stord_conf',
     173  Field('name','string'),"""
     174
     175for res in stor_res_list:
     176  print "  Field('stord_conf__%s', 'reference stord_conf__%s_link')," % (res,res )
     177print """  format='%(name)s')
     178"""
     179
     180
     181
     182for res in filed_res_list:   
     183  print """db.define_table('filed_conf__%s_link',
     184  Field('%s','reference filed_conf__%s'),
     185  format = '%%(id)s')
     186    """ % (res,res,res)
     187print """db.define_table('filed_conf',
     188  Field('name','string'),"""
     189
     190for res in filed_res_list:
     191  print "  Field('filed_conf__%s', 'reference filed_conf__%s_link')," % (res,res )
     192print """  format='%(name)s')
     193"""
     194
     195
     196
     197
     198for res in cons_res_list:   
     199  print """db.define_table('cons_conf__%s_link',
     200  Field('%s','reference cons_conf__%s'),
     201  format = '%%(id)s')
     202    """ % (res,res,res)
     203print """db.define_table('cons_conf',
     204  Field('name','string'),"""
     205
     206for res in cons_res_list:
     207  print "  Field('cons_conf__%s', 'reference cons_conf__%s_link')," % (res,res )
     208print """  format='%(name)s')
     209"""
     210
     211
     212#Abhängikeiten:
     213# dird
     214#  job/jobdefs   ->client
     215#                -> pool
     216#                -> fileset
     217#                -> pool
     218#                -> messages
     219#                -> schedule
     220#                -> storage
     221#                -> jobdefs
     222#                -> job
     223# messages   -> catalog
     224# counter    -> catalog
     225# storage    -> device
     226# director   -> messages
     227# client     -> catalog
     228# pool       -> catalog, storage
     229
     230
     231# Reihenfolge:
     232# storage->catalog->fileset->pool->jobdefs->client->
     233# counter->messages->job->director
     234
     235
     236
     237# stored:
     238# autochanger -> device
     239# storage  -> messages
     240# messages -> catalog
     241
     242# filed:
     243# messages -> catalog
     244# client/filedaemon -> messages
     245
     246
     247
     248
     249
Note: See TracChangeset for help on using the changeset viewer.