Alon Bar-Lev has posted comments on this change. Change subject: WIP: packaging: setup: Add host rename script ......................................................................
Patch Set 15: (11 comments) .................................................... File packaging/setup/bin/ovirt-engine-rename Line 65: environment="${environment} APPEND:CORE/configFileAppend=str:${v}" Line 66: ;; Line 67: --generate-answer=*) Line 68: environment="${environment} OVESETUP_CORE/answerFile=str:${v}" Line 69: ;; reminder... --new-name= parameter? Line 70: --help) Line 71: usage Line 72: ;; Line 73: *) .................................................... File packaging/setup/ovirt_engine_setup/constants.py Line 615: CONFIRM_UNINSTALL_GROUPS = 'OVESETUP_CORE/confirmUninstallGroups' Line 616: UPGRADE_SUPPORTED_VERSIONS = 'OVESETUP_CORE/upgradeSupportedVersions' Line 617: UPGRADE_FROM_LEGACY = 'OVESETUP_CORE/upgradeFromLegacy' Line 618: ACTION = 'OVESETUP_CORE/action' Line 619: FILES_TO_BE_MODIFIED = 'OVESETUP_CORE/filesToBeModified' are we sure this is not specific to rename? Line 620: Line 621: @osetupattrs( Line 622: answerfile=True, Line 623: ) Line 977: ) Line 978: def FQDN(self): Line 979: return 'OSETUP_RENAME/fqdn' Line 980: Line 981: CONFIRM_FORCE_OVERWRITE = 'OSETUP_RENAME/confirmForceOverwrite' No need for Confirm prefix :) Line 982: Line 983: Line 984: @util.export Line 985: @util.codegen .................................................... File packaging/setup/plugins/ovirt-engine-common/core/misc.py Line 107: _('Running as non root and not in development mode') Line 108: ) Line 109: Line 110: @plugin.event( Line 111: stage=plugin.Stages.STAGE_SETUP, why at core? Line 112: ) Line 113: def _setup(self): Line 114: if self.environment[osetupcons.CoreEnv.DEVELOPER_MODE]: Line 115: self.environment[ .................................................... File packaging/setup/plugins/ovirt-engine-rename/core/database.py Line 41: super(Plugin, self).__init__(context=context) Line 42: Line 43: @plugin.event( Line 44: stage=plugin.Stages.STAGE_MISC, Line 45: name=osetupcons.Stages.DB_CONNECTION_AVAILABLE, Won't it better to use database.OvirtUtils::tryDatabaseConnect? Line 46: ) Line 47: def _connection(self): Line 48: # must be here as we do not have database at validation Line 49: self.environment[ Line 78: u = urlparse.urlparse(value) Line 79: newvalue = urlparse.urlunparse( Line 80: ( Line 81: u.scheme, Line 82: newfqdn + ":" + u.port, you can really drop this newfqdn variable... this *is* a stupid class... you cannot modify nor create dictionary!!! try the following it will make it better... x = list(urlparse.urlparse('http://www.google.com/path')) x[1] = 'alon:12' y = urlparse.urlunparse(x) Line 83: u.path, Line 84: u.params, Line 85: u.query, Line 86: u.fragment # No "," as exactly 6 items are needed Line 89: self.environment[osetupcons.DBEnv.STATEMENT].updateVdcOptions( Line 90: options=( Line 91: { Line 92: 'name': option, Line 93: 'value': newvalue, can be urlparse.urlunparse(x) Line 94: }, Line 95: ) Line 96: ) Line 97: .................................................... File packaging/setup/plugins/ovirt-engine-rename/core/pki.py Line 220: ] Line 221: ) Line 222: Line 223: self.execute( Line 224: ( spaces Line 225: osetupcons.FileLocations.OVIRT_ENGINE_PKI_CA_ENROLL, Line 226: '--name=%s' % 'apache', Line 227: '--password=%s' % ( Line 228: self.environment[osetupcons.PKIEnv.STORE_PASS], Line 252: ), Line 253: ), Line 254: ) Line 255: Line 256: self.uninstall_files.extend( append if you use only one Line 257: ( Line 258: osetupcons.FileLocations.OVIRT_ENGINE_PKI_APACHE_KEY, Line 259: ) Line 260: ) .................................................... File packaging/setup/plugins/ovirt-engine-rename/core/protocols.py Line 63: osetupcons.FileLocations. Line 64: OVIRT_ENGINE_SERVICE_CONFIG_PROTOCOLS Line 65: ) Line 66: Line 67: with open(config, 'r') as f: I am sooooooooo sorry... you can use our own parser... I was completely confused today!!! We have our own parser that services are using located at pythonlib at packaging/pythonlib/ovirt_engine/configfile.py... see ovirt-engine.py from services. What we need is expose _values and maybe even have a method to extract string!!! Line 68: content = [] Line 69: for line in f: Line 70: line = line.rstrip('\n') Line 71: if line.startswith('ENGINE_FQDN='): .................................................... File packaging/setup/plugins/ovirt-engine-rename/core/uninstall.py this is my todo Line 1: # Line 2: # ovirt-engine-setup -- ovirt engine setup Line 3: # Copyright (C) 2013 Red Hat, Inc. Line 4: # -- To view, visit http://gerrit.ovirt.org/17408 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I28cb0285424236fd3e6907694f6bf1ce6ce3367f Gerrit-PatchSet: 15 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Yedidyah Bar David <d...@redhat.com> Gerrit-Reviewer: Alex Lourie <alou...@redhat.com> Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com> Gerrit-Reviewer: Moran Goldboim <mgold...@redhat.com> Gerrit-Reviewer: Ofer Schreiber <oschr...@redhat.com> Gerrit-Reviewer: Sandro Bonazzola <sbona...@redhat.com> Gerrit-Reviewer: Yedidyah Bar David <d...@redhat.com> Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches