Skip to content
This repository has been archived by the owner on Jun 5, 2023. It is now read-only.

Commit

Permalink
fix lt, gt for source and target tags (#2050)
Browse files Browse the repository at this point in the history
* fix lt, gt for source and target tags

* fix style
  • Loading branch information
rllin-fathom authored and blueandgold committed Oct 4, 2018
1 parent 395f7c3 commit 00bfc23
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions google/cloud/forseti/common/gcp_type/firewall_rule.py
Expand Up @@ -516,8 +516,10 @@ def __lt__(self, other):
other.direction is None)
network = (self.network == other.network or
other.network is None)
source_tags = set(self.source_tags).issubset(other.source_tags)
target_tags = set(self.target_tags).issubset(other.target_tags)
source_tags = (set(self.source_tags).issubset(other.source_tags) or not
other.source_tags)
target_tags = (set(self.target_tags).issubset(other.target_tags) or not
other.target_tags)
firewall_action = self.firewall_action < other.firewall_action
source_ranges = ips_in_list(self.source_ranges, other.source_ranges)
destination_ranges = ips_in_list(self.destination_ranges,
Expand Down Expand Up @@ -551,8 +553,10 @@ def __gt__(self, other):
network = (self.network is None or
other.network is None or
self.network == other.network)
source_tags = set(other.source_tags).issubset(self.source_tags)
target_tags = set(other.target_tags).issubset(self.target_tags)
source_tags = (set(other.source_tags).issubset(self.source_tags) or not
self.source_tags)
target_tags = (set(other.target_tags).issubset(self.target_tags) or not
self.target_tags)
firewall_action = self.firewall_action > other.firewall_action
source_ranges = ips_in_list(other.source_ranges, self.source_ranges)
destination_ranges = ips_in_list(other.destination_ranges,
Expand Down

0 comments on commit 00bfc23

Please sign in to comment.