[node-patches] Change in ovirt-node[master]: ovirt-ntpd: Adding ovirt-ntpd service

fabiand at redhat.com fabiand at redhat.com
Mon Jun 1 14:05:07 UTC 2015


Fabian Deutsch has posted comments on this change.

Change subject: ovirt-ntpd: Adding ovirt-ntpd service
......................................................................


Patch Set 2: Code-Review-1

(6 comments)

https://gerrit.ovirt.org/#/c/41617/2/services/ovirt-ntpd/ovirt-node-ntpd
File services/ovirt-ntpd/ovirt-node-ntpd:

Line 32:     def __init__(self):
Line 33:         self.kargs = None
Line 34:         self.logger = self._set_logger()
Line 35: 
Line 36:     def is_set(self):
Please extend config.defaults.Timeservers to provide the req. functionality.
Line 37:         """
Line 38:         Validate OVIRT_NODE_NTP in /etc/default/ovirt
Line 39:         if already set, no need to execute auto-register
Line 40: 


Line 47:                     return True
Line 48: 
Line 49:         return False
Line 50: 
Line 51:     def get_kargs(self):
Please use utils.system.kernel_cmdline_arguments()[…]
Line 52:         """
Line 53:         Find in the boot kernel arguments from /var/log/dmesg,
Line 54:         the key ntp
Line 55: 


Line 65:                     break
Line 66: 
Line 67:         return self.kargs
Line 68: 
Line 69:     def comment_servers(self):
Let#s use augeas instead to remove or disable the entries.
Line 70:         """
Line 71:         Comment the server entries from /etc/ntp.conf
Line 72:         """
Line 73:         _ntp_conf = "/etc/ntp.conf"


Line 89:         os.rename(f.name, _ntp_conf)
Line 90:         utils.fs.Config().persist(_ntp_conf)
Line 91:         self.logger.info("Commented the server entries from ntp.conf")
Line 92: 
Line 93:     def write_changes(self):
config.defaults.Timeserves can be used
Line 94:         """
Line 95:         Save OVIRT_NODE_NTP_AUTO_SERVERS into /etc/default/ovirt
Line 96:         for next service start check
Line 97:         """


Line 107:         log.propagate = False
Line 108:         log.setLevel(logging.DEBUG)
Line 109:         log.addHandler(journal.JournalHandler())
Line 110:         log.addHandler(
Line 111:             journal.JournalHandler(SYSLOG_IDENTIFIER='ovirt-node-ntp')
Nice idea.
Line 112:         )
Line 113:  
Line 114:         return log
Line 115: 


Line 109:         log.addHandler(journal.JournalHandler())
Line 110:         log.addHandler(
Line 111:             journal.JournalHandler(SYSLOG_IDENTIFIER='ovirt-node-ntp')
Line 112:         )
Line 113:  
WhitespaCE
Line 114:         return log
Line 115: 
Line 116: 
Line 117: def main():


-- 
To view, visit https://gerrit.ovirt.org/41617
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib7827ab15b23b71d18b4562a0f2fc8a475f16378
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Douglas Schilling Landgraf <dougsland at redhat.com>
Gerrit-Reviewer: Douglas Schilling Landgraf <dougsland at redhat.com>
Gerrit-Reviewer: Fabian Deutsch <fabiand at redhat.com>
Gerrit-Reviewer: Ryan Barry <rbarry at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-HasComments: Yes



More information about the node-patches mailing list