Martin Sivák has posted comments on this change.

Change subject: WIP: broker: cfg: move broker.conf to shared storage
......................................................................


Patch Set 2: Code-Review-1

(4 comments)

https://gerrit.ovirt.org/#/c/39073/2/ovirt_hosted_engine_ha/broker/listener.py
File ovirt_hosted_engine_ha/broker/listener.py:

Line 265:         elif type == 'get-broker-conf':
Line 266:             options = self._get_options(tokens)
Line 267:             cfg = self.server.sp_listener.storage_broker_instance \
Line 268:                 .get_broker_conf(client, **options)
Line 269:             return cfg
The listener has to return string encoded data.
Line 270:         elif type == 'get-stats':
Line 271:             options = self._get_options(tokens)
Line 272:             with 
self.server.sp_listener.storage_broker_instance_access_lock:
Line 273:                 stats = 
self.server.sp_listener.storage_broker_instance \


https://gerrit.ovirt.org/#/c/39073/2/ovirt_hosted_engine_ha/broker/notifications.py
File ovirt_hosted_engine_ha/broker/notifications.py:

Line 61: 
Line 62:     assert "type" in kwargs
Line 63:     type = kwargs["type"]
Line 64: 
Line 65:     cfg = kwargs["cfg"]
You should make sure the cfg key is here as well I think.
Line 66:     detail = kwargs.get("detail", "")
Line 67: 
Line 68:     try:
Line 69:         rules = cfg.get("notify", type)


https://gerrit.ovirt.org/#/c/39073/2/ovirt_hosted_engine_ha/broker/storage_broker.py
File ovirt_hosted_engine_ha/broker/storage_broker.py:

Line 219:             content = None
Line 220:             try:
Line 221:                 f = io.open(path, "r")
Line 222:                 byte_data = f.read()
Line 223:                 content = base64.b16encode(byte_data)
Why is the config file base64 encoded?
Line 224:             except IOError as e:
Line 225:                 self._log.error("Failed to read broker.conf from %s",
Line 226:                                 path, exc_info=True)
Line 227:                 if e.errno == errno.ENOENT:


Line 255:         f = None
Line 256:         try:
Line 257:             path = self._backends[client].filename('broker.conf')[0]
Line 258:             f = io.open(path, "w")
Line 259:             f.write(byte_data)
This will blow up on iSCSI (VDSM & LVM based storage) as there is no VDSM 
device for broker.conf.
Line 260:         finally:
Line 261:             if f:
Line 262:                 f.close()
Line 263:         return content


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Iea4aec09be6125676a03304a2d0dccfa3d10757c
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-hosted-engine-ha
Gerrit-Branch: master
Gerrit-Owner: Sandro Bonazzola <sbona...@redhat.com>
Gerrit-Reviewer: Lev Veyde <lve...@redhat.com>
Gerrit-Reviewer: Martin Sivák <msi...@redhat.com>
Gerrit-Reviewer: Roy Golan <rgo...@redhat.com>
Gerrit-Reviewer: Simone Tiraboschi <stira...@redhat.com>
Gerrit-Reviewer: Yedidyah Bar David <d...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to