add_rule command for firewall
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
-
101 self.add_rule(port, 'udp', action, dir, owner, vlan, fnet) 102 103 def add_rule(self, port, proto, action, dir, owner, vlan, fnet): 104 105 if self.is_exist(port, proto, action, dir, owner, vlan, fnet): 106 raise CommandError('Rule does exist, yet') 107 108 rule = Rule(direction=dir, dport=port, proto=proto, action=action, 109 vlan=vlan, foreign_network=fnet, owner=owner) 110 111 rule.save() 112 113 def is_exist(self, port, proto, action, dir, owner, vlan, fnet): 114 115 try: 116 Rule.objects.get(direction=dir, dport=port, proto=proto, -
Owner
Rule.objects.filter(blabla='szia').exists()
-
-
95 raise CommandError("VlanGroup '%s' does not exist" % fnet) 96 97 if proto: 98 self.add_rule(port, proto, action, dir, owner, vlan, fnet) 99 else: 100 self.add_rule(port, 'tcp', action, dir, owner, vlan, fnet) 101 self.add_rule(port, 'udp', action, dir, owner, vlan, fnet) 102 103 def add_rule(self, port, proto, action, dir, owner, vlan, fnet): 104 105 if self.is_exist(port, proto, action, dir, owner, vlan, fnet): 106 raise CommandError('Rule does exist, yet') 107 108 rule = Rule(direction=dir, dport=port, proto=proto, action=action, 109 vlan=vlan, foreign_network=fnet, owner=owner) 110 -
Owner
rule.full_clean()
-
-
Added 37 commits:
-
c7fd2925...dad93220 - 36 commits from branch
master
- 10261b9a - Merge branch 'master' of https://git.ik.bme.hu/circle/cloud into add_rule
Toggle commit list -
c7fd2925...dad93220 - 36 commits from branch
-
Status changed to closed
Toggle commit list -
Status changed to reopened
Toggle commit list -
Status changed to merged
Toggle commit list