Yedidyah Bar David has posted comments on this change.

Change subject: packaging: setup: update firewall for all services
......................................................................


Patch Set 11:

(2 comments)

....................................................
File packaging/setup/plugins/ovirt-engine-setup/network/firewall_manager.py
Line 232:                     ),
Line 233:                     prompt=True,
Line 234:                     validValues=managers,
Line 235:                     caseSensitive=False,
Line 236:                     default=(active_managers + managers)[0],
> I repeat comment from previous patches:

> I want simpler algorithm... this what I always want.

Ok. I think the algorithm is pretty simple, that's what I tried to do.

> The following is not something I understand:
> (active_managers + managers)[0]

Sandro explained what it does, now replaced with something hopefully more 
understandable. I wouldn't personally call this single line "a complex 
algorithm".

> Please try to adjust the code to 'supported', 'available', 'selected' and see 
> what you ends with.

I agree that 'managers' wasn't clear. Now changed to available_managers.

BTW, this causes line 165 to be too long, and I am not sure how you wanted this 
fixed, following
our recent discussions. Comments are welcome.

There are no multiple 'selected' managers - there is only one, it's kept in 
exactly a single place,
which is self.environment[osetupcons.ConfigEnv.FIREWALL_MANAGER] .

> As far as I understand you use another variable 'detected' just to print what 
> you found, but there is no reason to mix between these, and you can print the 
> 'detected' as simple note.

What? I don't see a variable 'detected'. Perhaps you refer to 
'active_managers'? It's used to print, and to set the default answer.

> available = set(supported) - set(detected)

> selected = available[n]

This is where I lose you. If in 'detected' you refer to 'active_managers', 
meaning those that are currently active (at most one, really), then you mean 
the user can't select to keep his currently active manager? Why?
Line 237:                 )
Line 238: 
Line 239:                 for manager in managers:
Line 240:                     if response.lower() == manager.lower():


Line 232:                     ),
Line 233:                     prompt=True,
Line 234:                     validValues=managers,
Line 235:                     caseSensitive=False,
Line 236:                     default=(active_managers + managers)[0],
OK, replaced with simpler (and longer) code.
Line 237:                 )
Line 238: 
Line 239:                 for manager in managers:
Line 240:                     if response.lower() == manager.lower():


-- 
To view, visit http://gerrit.ovirt.org/20737
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: If3c1a634b2e8539ebd604205b5487290c8d8a1a9
Gerrit-PatchSet: 11
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Yedidyah Bar David <d...@redhat.com>
Gerrit-Reviewer: Alon Bar-Lev <alo...@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-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