Standardise docstring summary line placement.
This commit is contained in:
@@ -35,7 +35,8 @@ class AccessControlList:
|
||||
return False
|
||||
|
||||
def is_blocked(self, _source_ip_address, _dest_ip_address, _protocol, _port):
|
||||
"""Checks for rules that block a protocol / port.
|
||||
"""
|
||||
Checks for rules that block a protocol / port.
|
||||
|
||||
Args:
|
||||
_source_ip_address: the source IP address to check
|
||||
@@ -61,7 +62,8 @@ class AccessControlList:
|
||||
return True
|
||||
|
||||
def add_rule(self, _permission, _source_ip, _dest_ip, _protocol, _port):
|
||||
"""Adds a new rule.
|
||||
"""
|
||||
Adds a new rule.
|
||||
|
||||
Args:
|
||||
_permission: the permission value (e.g. "ALLOW" or "DENY")
|
||||
@@ -75,7 +77,8 @@ class AccessControlList:
|
||||
self.acl[hash_value] = new_rule
|
||||
|
||||
def remove_rule(self, _permission, _source_ip, _dest_ip, _protocol, _port):
|
||||
"""Removes a rule.
|
||||
"""
|
||||
Removes a rule.
|
||||
|
||||
Args:
|
||||
_permission: the permission value (e.g. "ALLOW" or "DENY")
|
||||
@@ -97,7 +100,8 @@ class AccessControlList:
|
||||
self.acl.clear()
|
||||
|
||||
def get_dictionary_hash(self, _permission, _source_ip, _dest_ip, _protocol, _port):
|
||||
"""Produces a hash value for a rule.
|
||||
"""
|
||||
Produces a hash value for a rule.
|
||||
|
||||
Args:
|
||||
_permission: the permission value (e.g. "ALLOW" or "DENY")
|
||||
|
||||
@@ -22,7 +22,8 @@ class ACLRule:
|
||||
self.port = _port
|
||||
|
||||
def __hash__(self):
|
||||
"""Override the hash function.
|
||||
"""
|
||||
Override the hash function.
|
||||
|
||||
Returns:
|
||||
Returns hash of core parameters.
|
||||
@@ -38,7 +39,8 @@ class ACLRule:
|
||||
)
|
||||
|
||||
def get_permission(self):
|
||||
"""Gets the permission attribute.
|
||||
"""
|
||||
Gets the permission attribute.
|
||||
|
||||
Returns:
|
||||
Returns permission attribute
|
||||
@@ -46,7 +48,8 @@ class ACLRule:
|
||||
return self.permission
|
||||
|
||||
def get_source_ip(self):
|
||||
"""Gets the source IP address attribute.
|
||||
"""
|
||||
Gets the source IP address attribute.
|
||||
|
||||
Returns:
|
||||
Returns source IP address attribute
|
||||
@@ -54,7 +57,8 @@ class ACLRule:
|
||||
return self.source_ip
|
||||
|
||||
def get_dest_ip(self):
|
||||
"""Gets the desintation IP address attribute.
|
||||
"""
|
||||
Gets the desintation IP address attribute.
|
||||
|
||||
Returns:
|
||||
Returns destination IP address attribute
|
||||
@@ -62,7 +66,8 @@ class ACLRule:
|
||||
return self.dest_ip
|
||||
|
||||
def get_protocol(self):
|
||||
"""Gets the protocol attribute.
|
||||
"""
|
||||
Gets the protocol attribute.
|
||||
|
||||
Returns:
|
||||
Returns protocol attribute
|
||||
@@ -70,7 +75,8 @@ class ACLRule:
|
||||
return self.protocol
|
||||
|
||||
def get_port(self):
|
||||
"""Gets the port attribute.
|
||||
"""
|
||||
Gets the port attribute.
|
||||
|
||||
Returns:
|
||||
Returns port attribute
|
||||
|
||||
Reference in New Issue
Block a user