Skip to content

Empty all rules notes after push rules from SoftLayer.FirewallManager.get_dedicated_fwl_rules#751

Merged
sudorandom merged 1 commit intosoftlayer:masterfrom
rnt:master
Aug 16, 2016
Merged

Empty all rules notes after push rules from SoftLayer.FirewallManager.get_dedicated_fwl_rules#751
sudorandom merged 1 commit intosoftlayer:masterfrom
rnt:master

Conversation

@rnt
Copy link
Copy Markdown
Contributor

@rnt rnt commented Aug 15, 2016

If you use something like this to upload your rules, you will empty all rules notes:

[...]
client = SoftLayer.create_client_from_env()
manager = SoftLayer.FirewallManager(client)

vlan = 1234  # your vlan number
firewalls = manager.get_firewalls()

vlan_firewall = [firewall for firewall in firewalls if firewall['vlanNumber'] == vlan][0]

# This output include notes.
# rules = vlan_firewall['firewallRules']

# This output do not include notes.
rules = list(manager.get_dedicated_fwl_rules(vlan_firewall['networkVlanFirewall']['id']))

output = manager.edit_dedicated_fwl_rules(vlan_firewall['networkVlanFirewall']['id'], rules)

To fix this use, you need to add notes to RULE_MASK in firewall manager.

@coveralls
Copy link
Copy Markdown

coveralls commented Aug 15, 2016

Coverage Status

Coverage remained the same at 81.008% when pulling 69b7f65 on rnt:master into e504d43 on softlayer:master.

@sudorandom sudorandom merged commit b07a190 into softlayer:master Aug 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants