Commit b1b0e86f authored by Alain Takoudjou's avatar Alain Takoudjou

firewalld used to restrict access between partitions (only on tap ipv4)

firewall process is now controlled by supervisord

slapos firewall: speed up computer_partitions configuration

slapos firewall: block etablished and related connection which are not allowed
parent 393bb540
...@@ -274,28 +274,19 @@ class SlapTool(BaseTool): ...@@ -274,28 +274,19 @@ class SlapTool(BaseTool):
@UnrestrictedMethod @UnrestrictedMethod
def _getHostingSubscriptionIpList(self, computer_id, computer_partition_id): def _getHostingSubscriptionIpList(self, computer_id, computer_partition_id):
def getHostingSubscriptionInstanceList(software_instance):
pred_list = []
if software_instance is None or software_instance.getSlapState() == 'destroy_requested':
return pred_list
else:
if software_instance.getPortalType() == 'Software Instance':
pred_list.append(software_instance)
predecessor_list = software_instance.getPredecessorValueList(
portal_type="Software Instance")
for instance in predecessor_list:
pred_list.extend(getHostingSubscriptionInstanceList(instance))
return pred_list
software_instance = self._getSoftwareInstanceForComputerPartition( software_instance = self._getSoftwareInstanceForComputerPartition(
computer_id, computer_partition_id) computer_id, computer_partition_id)
if software_instance is None or \
software_instance.getSlapState() == 'destroy_requested':
return xml_marshaller.xml_marshaller.dumps([])
# Search hosting subscription # Search hosting subscription
hosting = software_instance.getSpecialiseValue() hosting = software_instance.getSpecialiseValue()
while hosting and hosting.getPortalType() != "Hosting Subscription": while hosting and hosting.getPortalType() != "Hosting Subscription":
hosting = hosting.getSpecialiseValue() hosting = hosting.getSpecialiseValue()
ip_address_list = [] ip_address_list = []
for instance in getHostingSubscriptionInstanceList(hosting): for instance in hosting.getSpecialiseRelatedValueList(
portal_type="Software Instance"):
computer_partition = instance.getAggregateValue(portal_type="Computer Partition") computer_partition = instance.getAggregateValue(portal_type="Computer Partition")
if not computer_partition: if not computer_partition:
continue continue
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment