Alon Bar-Lev has posted comments on this change.
Change subject: engine_page: rewrite register
......................................................................
Patch Set 1:
(14 comments)
....................................................
File src/engine_page.py
Line 340: # pylint: enable-msg=E0611,F0401
Line 341:
Line 342: cfg = VDSM().retrieve()
Line 343:
Line 344: if self._newreg == False:
if not self._newreg:
Line 345: self.logger.info("VDSM-reg registering..")
Line 346: # Stopping vdsm-reg may fail but its ok - its in the case
when the
Line 347: # menus are run after installation
Line 348: self.logger.info("Stopping vdsm-reg service")
....................................................
File src/misc.py
Line 18: # MA 02110-1301, USA. A copy of the GNU General Public License is
Line 19: # also available at http://www.gnu.org/copyleft/gpl.html.
Line 20:
Line 21: import os
Line 22: import os.path
import os should be sufficient.
Line 23: import platform
Line 24: import logging
Line 25: import traceback
Line 26: import subprocess
Line 25: import traceback
Line 26: import subprocess
Line 27:
Line 28: EX_DMIDECODE = '/usr/sbin/dmidecode'
Line 29: P_VDSM_NODE_ID = '/etc/vdsm/vdsm.id'
Move constants into class scope
Line 30:
Line 31: class Misc:
Line 32:
Line 33: def isOvirt():
Line 27:
Line 28: EX_DMIDECODE = '/usr/sbin/dmidecode'
Line 29: P_VDSM_NODE_ID = '/etc/vdsm/vdsm.id'
Line 30:
Line 31: class Misc:
class Misc(object):
Line 32:
Line 33: def isOvirt():
Line 34: """
Line 35: This function checks if current machine runs ovirt
platform.
Line 29: P_VDSM_NODE_ID = '/etc/vdsm/vdsm.id'
Line 30:
Line 31: class Misc:
Line 32:
Line 33: def isOvirt():
of course it is ovirt, please remove
Line 34: """
Line 35: This function checks if current machine runs ovirt
platform.
Line 36: """
Line 37: if os.path.exists('/etc/rhev-hypervisor-release'):
Line 40: return True
Line 41: else:
Line 42: return False
Line 43:
Line 44: def _logExec(argv, input=None):
please use otopi::plugin.py execute as base
Line 45: """
Line 46: This function executes a given shell command while logging
it.
Line 47: """
Line 48: out = None
Line 76: print "====="
Line 77: print out
Line 78: print err
Line 79: print ret
Line 80: print "====="
do not print output
Line 81: out = '\n'.join(line for line in out.splitlines()
Line 82: if not line.startswith('#'))
Line 83:
Line 84: # Avoid error string- 'Not Settable' or 'Not Present'
Line 82: if not line.startswith('#'))
Line 83:
Line 84: # Avoid error string- 'Not Settable' or 'Not Present'
Line 85: if ret == 0 and "Not" not in out:
Line 86: return out.replace("\n", "")
if Not exists then generate uuid and write /etc/vdsm/vdsm.id and persist
Line 87: elif arch == "ppc64":
Line 88: if os.path.exists('/proc/device-tree/system-id'):
Line 89: #eg. output IBM,03061C14A
Line 90: return file('/proc/device-tree/system-id').readline().\
Line 87: elif arch == "ppc64":
Line 88: if os.path.exists('/proc/device-tree/system-id'):
Line 89: #eg. output IBM,03061C14A
Line 90: return file('/proc/device-tree/system-id').readline().\
Line 91: replace(",", "")
take from ovirt-host-deploy::vdsmid.py
Line 92:
Line 93: logging.error("getMachineUUID: Could not find machine's UUID.")
Line 94:
Line 95: return "None"
Line 91: replace(",", "")
Line 92:
Line 93: logging.error("getMachineUUID: Could not find machine's UUID.")
Line 94:
Line 95: return "None"
raise exception as you cannot get id
Line 96:
Line 97: def getHostID(self):
Line 98: """
Line 99: This function concatenate the first serted mac address to
the machine's
Line 93: logging.error("getMachineUUID: Could not find machine's UUID.")
Line 94:
Line 95: return "None"
Line 96:
Line 97: def getHostID(self):
this should be removed
Line 98: """
Line 99: This function concatenate the first serted mac address to
the machine's
Line 100: UUID.
Line 101: """
....................................................
File src/network.py
why do you need this?
Line 1: #!/usr/bin/python
Line 2: # -*- coding: utf-8 -*-
Line 3: #
Line 4: # network.py - Copyright (C) 2013 Red Hat, Inc.
Line 21: import socket
Line 22: import struct
Line 23: from vdsm import netinfo
Line 24:
Line 25: class Network:
class Network(object):
Line 26:
Line 27: def _getIfaceByIP(self, addr):
Line 28: remote = struct.unpack('I', socket.inet_aton(addr))[0]
Line 29: for line in file('/proc/net/route').readlines()[1:]:
Line 58:
Line 59: return strReturn
Line 60:
Line 61: def getMGTIP(self, vdcHostName):
Line 62:
spaces
Line 63: strReturn = None
Line 64: strIface = self._getMGTIface(vdcHostName)
Line 65:
Line 66: if strIface is not None:
--
To view, visit http://gerrit.ovirt.org/17682
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I38f3b800c445f8dbb0fa0e89d128cea1e3407798
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node-plugin-vdsm
Gerrit-Branch: master
Gerrit-Owner: Douglas Schilling Landgraf <[email protected]>
Gerrit-Reviewer: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches