Exemplo n.º 1
0
 def _action(self):
     params = web.input()
     clusternodename = params['clusternodename']
     clusternodedisk = clusnodelib.func_node_disk_info(clusternodename)
     clusternodedisklight_status = clusnodelib.func_node_get_disk_lightstatus(
         clusternodename)
     diskinfo = []
     for disk in clusternodedisk:
         if disk['position'] == "-1":
             if disk['devname'] not in clusternodedisklight_status:
                 disk['light_status'] = 'greenlight'
             else:
                 disk['light_status'] = 'redlight'
             diskinfo.append(disk)
             print >> sys.stderr, disk
         else:
             if disk['devname'] not in clusternodedisklight_status:
                 disk['light_status'] = 'greenlight'
             else:
                 disk['light_status'] = 'redlight'
             diskinfo.append(disk)
     print >> sys.stderr, '---------------------------------------------------'
     print >> sys.stderr, diskinfo
     print >> sys.stderr, '---------------------------------------------------'
     return simplejson.dumps(diskinfo)
Exemplo n.º 2
0
 def _action(self):
     params = web.input()
     node = session.runtime.node
     unit = 'unit' in params and params['unit'] or None
     if unit:
         session.runtime.unit = unit
     clusternodediskinfo = clusnodelib.func_node_disk_info(node, unit)
     return simplejson.dumps(clusternodediskinfo)
Exemplo n.º 3
0
 def _action(self):
     clusterservicediskinfo = []
     clusterservicedisk = clusnodelib.func_node_disk_info()
     for disk in clusterservicedisk:
         if disk['status'] == 'unused':
             clusterservicediskinfo.append(disk)
     print >>sys.stderr, clusterservicediskinfo
     return simplejson.dumps(clusterservicediskinfo)
Exemplo n.º 4
0
 def _logic(self):
     clusterservicediskinfo = []
     clusterservicedisk = clusnodelib.func_node_disk_info()
     for disk in clusterservicedisk:
         if disk['status'] == 'unused':
             clusterservicediskinfo.append(disk)
             self.content = stow(
                 {'clusterservicediskinfo': clusterservicediskinfo})
             self.setup = stow({'template': 'clusterservicecreateguide_c'})
Exemplo n.º 5
0
 def _logic(self):
     node = session.runtime.node
     unit = session.runtime.unit
     clusternoderaid = []
     clusternoderaidinfo = clusnodelib.func_node_list_raid(node, '')
     for raid in clusnodelib.func_node_disk_info(node):
         if raid['type'] == 'raid':
             clusternoderaid.append(raid['devname'])
     self.content = stow({'clusternoderaid': clusternoderaid})
     self.setup = stow({'template': 'clusternoderaiddel_hs'})
Exemplo n.º 6
0
 def _logic(self):
     #node = session.runtime.node
     params = web.input()
     node = params['node']
     unit = session.runtime.unit
     clusternodediskunused = []
     for disk in clusnodelib.func_node_disk_info(node, unit):
         if disk['status'] == 'unused' and disk['type'] != 'raid':
             clusternodediskunused.append(disk['devname'])
     self.content = stow({
         'clusternodediskunused': clusternodediskunused,
     })
     self.setup = stow({'template': 'clusternoderaidcreate'})
Exemplo n.º 7
0
 def _logic(self):
     node = session.runtime.node
     clusternodediskunused = []
     clusternoderaid = []
     for disk in clusnodelib.func_node_disk_info(node):
         if disk['status'] == 'unused' and disk['type'] != 'raid':
             clusternodediskunused.append(disk['devname'])
         if disk['type'] == 'raid' and disk['vandor'] != '0':
             clusternoderaid.append(disk['devname'])
     self.content = stow({
         'clusternodediskunused': clusternodediskunused,
         'clusternoderaid': clusternoderaid
     })
     self.setup = stow({'template': 'clusternoderaidset_hs'})
Exemplo n.º 8
0
 def _logic(self):
     node = session.runtime.node
     unit = session.runtime.unit
     clusternodediskinfo = clusnodelib.func_node_disk_info(node, unit)
     clusternoderaidinfo = clusnodelib.func_node_raid_info(node, unit)
     self.content = stow({
         'clusternodediskinfo': clusternodediskinfo,
         'clusternoderaidinfo': clusternoderaidinfo,
         'unit': unit,
         'is_unused': '0'
     })
     self.setup = stow({
         'jstemplate': ['datatable_ZH'],
         'template': 'clusternoderaidload',
     })
Exemplo n.º 9
0
 def _logic(self):
     clusterdiskunused = []
     clusternodediskinfo = []
     clusternodedisksize = []
     clusternewservicedev = {}
     params = web.input()
     disk = clusnodelib.func_node_disk_info(params['clusternodeipaddr'])
     for d in disk:
         if d['status'] == 'unused':
             dev = params['clusternodeipaddr'] + ':' + d['devname']
             diskinfo = 'model:' + d['vandor'] + '<br />' + 'serial_number:' +d['sn_number'] + '<br />' + 'size:' + d['size']
             clusternodediskinfo.append(diskinfo)
             clusterdiskunused.append(dev)
             clusternewservicedev['clusterdiskunused'] = clusterdiskunused
             clusternewservicedev['clusternodediskinfo'] = clusternodediskinfo
     return simplejson.dumps(clusternewservicedev)
Exemplo n.º 10
0
    def _logic(self):
        #node = session.runtime.node
        node = ''
        unit = session.runtime.unit
        clusternodediskinfo = clusnodelib.func_node_disk_info(node,unit)
        clusternoderaidinfo = clusnodelib.func_node_raid_info(node,unit)
        self.content = stow({
            'clusternodediskinfo':clusternodediskinfo,
            'clusternoderaidinfo':clusternoderaidinfo,
			'is_service':'1'
        })
        self.setup = stow({
            'template':'clusternodedisk',
            #'breadcrumbs':['clusternode','clusternodeview','clusternodedisk'],
            #'menus':gmenus,
            #'currmenu':'clusternodedisk',
        })
Exemplo n.º 11
0
 def _logic(self):       
     params = web.input()
     unit = session.runtime.unit
     disk_arr = clusnodelib.func_node_disk_info('',unit)
     unuse_disk=[]
     for disk in disk_arr:
         if disk['status']=='unused':
             unuse_disk.append(disk['nodename']+':'+disk['devname'])
     unuse_disk_str=','.join(unuse_disk)			
     self.content = stow({
         'service_name':params['service_name'],
         'disk':params['disk'],
         'unuse_disk_str':unuse_disk_str,
     })
     self.setup = stow({
         'template':'clusterservicediskreplace',
     })
Exemplo n.º 12
0
 def _logic(self):
     node = session.runtime.node
     unit = session.runtime.unit
     clusternodediskunused = []
     clusterwarnservice = []
     clusterservice = []
     for disk in clusnodelib.func_node_disk_info(node, unit):
         if disk['status'] == 'unused' and disk['type'] != 'raid':
             clusternodediskunused.append(disk['devname'])
     serviceinfos = clusservicelib.func_service_list_all()
     for serviceinfo in serviceinfos:
         clusterservice.append(serviceinfo['servicename'])
         if 'status' in serviceinfo and serviceinfo['status'] == 'Warnning':
             clusterwarnservice.append(serviceinfo['servicename'])
     self.content = stow({
         'clusternodediskunused': clusternodediskunused,
         'clusterwarnservice': clusterwarnservice,
         'clusterservice': clusterservice
     })
     self.setup = stow({'template': 'clusternodereplacenodisk'})
Exemplo n.º 13
0
 def _action(self):
     unit = session.runtime.unit
     params = web.input()
     node = params['node']
     clusternodediskinfo = clusnodelib.func_node_disk_info(node, unit)
     return simplejson.dumps(clusternodediskinfo)