Douglas Schilling Landgraf has uploaded a new change for review.
Change subject: register: handle non uuid machines ......................................................................
register: handle non uuid machines
If user machines doesn't provide UUID data this patch collects a random UUID from system.
Change-Id: I9429e46895a73178cf459d5ced5d39499e993922 Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1268854 Signed-off-by: Douglas Schilling Landgraf dougsland@redhat.com --- M lib/vdsm/tool/register.py 1 file changed, 11 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/85/47385/1
diff --git a/lib/vdsm/tool/register.py b/lib/vdsm/tool/register.py index 47c8412..d088bfc 100644 --- a/lib/vdsm/tool/register.py +++ b/lib/vdsm/tool/register.py @@ -256,7 +256,17 @@ if self.vdsm_uuid: self.uuid = self.vdsm_uuid else: - self.uuid = getHostUUID(legacy=False) + uuid_node = getHostUUID(legacy=False) + if uuid_node is None: + self.logger.debug("Collecting random UUID from system") + random_uuid_path = '/proc/sys/kernel/random/uuid' + if os.path.exists(random_uuid_path): + with open(random_uuid_path, 'r') as f: + self.uuid = f.readline().strip() + else: + raise RuntimeError("Unable to determine host UUID!") + else: + self.uuid = uuid_node
self.url_reg += "&uniqueId={u}".format(u=self.uuid)
automation@ovirt.org has posted comments on this change.
Change subject: register: handle non uuid machines ......................................................................
Patch Set 1:
* Update tracker::#1268854::OK * Check Bug-Url::OK * Check Public Bug::#1268854::OK, public bug * Check Product::#1268854::OK, Correct product Red Hat Enterprise Virtualization Manager * Check TM::SKIP, not in a monitored branch (ovirt-3.5 ovirt-3.4 ovirt-3.3 ovirt-3.2) * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
Douglas Schilling Landgraf has posted comments on this change.
Change subject: register: handle non uuid machines ......................................................................
Patch Set 1: Verified+1
Dan Kenigsberg has posted comments on this change.
Change subject: register: handle non uuid machines ......................................................................
Patch Set 1: Code-Review-1
(1 comment)
https://gerrit.ovirt.org/#/c/47385/1/lib/vdsm/tool/register.py File lib/vdsm/tool/register.py:
Line 257: self.uuid = self.vdsm_uuid Line 258: else: Line 259: uuid_node = getHostUUID(legacy=False) Line 260: if uuid_node is None: Line 261: self.logger.debug("Collecting random UUID from system") use uuid.uuid4() instead.
But more importantly, I don't know why we should fix this bug. It has been an intentional semantics to request user intervention for such hosts, hasn't it?
What's the 3.5 behavior? Line 262: random_uuid_path = '/proc/sys/kernel/random/uuid' Line 263: if os.path.exists(random_uuid_path): Line 264: with open(random_uuid_path, 'r') as f: Line 265: self.uuid = f.readline().strip()
Douglas Schilling Landgraf has posted comments on this change.
Change subject: register: handle non uuid machines ......................................................................
Patch Set 1:
(1 comment)
https://gerrit.ovirt.org/#/c/47385/1/lib/vdsm/tool/register.py File lib/vdsm/tool/register.py:
Line 257: self.uuid = self.vdsm_uuid Line 258: else: Line 259: uuid_node = getHostUUID(legacy=False) Line 260: if uuid_node is None: Line 261: self.logger.debug("Collecting random UUID from system")
use uuid.uuid4() instead.
Fabian? Line 262: random_uuid_path = '/proc/sys/kernel/random/uuid' Line 263: if os.path.exists(random_uuid_path): Line 264: with open(random_uuid_path, 'r') as f: Line 265: self.uuid = f.readline().strip()
Jenkins CI RO has abandoned this change.
Change subject: register: handle non uuid machines ......................................................................
Abandoned
Abandoned due to no activity - please restore if still relevant
gerrit-hooks has posted comments on this change.
Change subject: register: handle non uuid machines ......................................................................
Patch Set 2:
* #1268854::Update tracker: OK
vdsm-patches@lists.fedorahosted.org