Github user wilderrodrigues commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/1346#discussion_r50251936 --- Diff: systemvm/patches/debian/config/opt/cloud/bin/configure.py --- @@ -901,79 +901,123 @@ def processStaticNatRule(self, rule): def main(argv): + # The file we are currently processing, if it is "cmd_line.json" everything will be processed. + process_file = argv[1] + + # process_file can be None, if so assume cmd_line.json + if process_file is None: + process_file = "cmd_line.json" + + # Track if changes need to be committed to NetFilter + iptables_change = False + + # The "GLOBAL" Configuration object config = CsConfig() + logging.basicConfig(filename=config.get_logger(), level=config.get_level(), format=config.get_format()) + + # Load stored ip adresses from disk to CsConfig() config.set_address() logging.debug("Configuring ip addresses") - # IP configuration config.address().compare() config.address().process() - logging.debug("Configuring vmpassword") - password = CsPassword("vmpassword", config) - password.process() + if process_file in ["cmd_line.json", "guest_network.json"]: + logging.debug("Configuring Guest Network") + iptables_change = True + + if process_file in ["cmd_line.json", "vm_password.json"]: + logging.debug("Configuring vmpassword") + password = CsPassword("vmpassword", config) + password.process() - logging.debug("Configuring vmdata") - metadata = CsVmMetadata('vmdata', config) - metadata.process() + if process_file in ["cmd_line.json", "vm_metadata.json"]: + logging.debug("Configuring vmdata") + metadata = CsVmMetadata('vmdata', config) + metadata.process() - logging.debug("Configuring networkacl") + # Always run both CsAcl().process() methods + # They fill the base rules in config.fw[] acls = CsAcl('networkacl', config) acls.process() - logging.debug("Configuring firewall rules") acls = CsAcl('firewallrules', config) acls.process() - logging.debug("Configuring PF rules") fwd = CsForwardingRules("forwardingrules", config) fwd.process() - logging.debug("Configuring s2s vpn") vpns = CsSite2SiteVpn("site2sitevpn", config) vpns.process() - logging.debug("Configuring remote access vpn") - #remote access vpn rvpn = CsRemoteAccessVpn("remoteaccessvpn", config) rvpn.process() - logging.debug("Configuring vpn users list") - #remote access vpn users - vpnuser = CsVpnUser("vpnuserlist", config) - vpnuser.process() - - logging.debug("Configuring dhcp entry") - dhcp = CsDhcp("dhcpentry", config) - dhcp.process() - - logging.debug("Configuring load balancer") lb = CsLoadBalancer("loadbalancer", config) lb.process() - logging.debug("Configuring monitor service") - mon = CsMonitor("monitorservice", config) - mon.process() + if process_file in ["cmd_line.json", "network_acl.json"]: + logging.debug("Configuring networkacl") + iptables_change = True + + if process_file in ["cmd_line.json", "firewall_rules.json"]: + logging.debug("Configuring firewall rules") + iptables_change = True + + if process_file in ["cmd_line.json", "forwarding_rules.json", "staticnat_rules.json"]: + logging.debug("Configuring PF rules") --- End diff -- @pdube The point behind those changes was to avoid all the commands in the routers being called all the time. For example, add a FW rule to a router, all the other methods, not even related, were being executed. That was causing issues when one wanted to send several commands to the routers. Sometimes ACS was even timing out. The difference in the code added by @borisroman is that now all the configuration files are checked before executing the methods. Cheers, Wilder
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---