@@ -40,16 +40,17 @@ def __init__(self, client):
4040 self .account = self .client ['Account' ]
4141 self .prod_pkg = self .client ['Product_Package' ]
4242
43- def get_standard_package (self , server_id , is_cci = True ):
44- """Retrieves the standard firewall package for the CCI .
43+ def get_standard_package (self , server_id , is_virt = True ):
44+ """Retrieves the standard firewall package for the virtual server .
4545
4646 :param int server_id: The ID of the server to create the firewall for
47- :param bool is_cci: True if the id provided is for a CCI,
48- False for a server
49- :returns: A dictionary containing the standard CCI firewall package
47+ :param bool is_virt: True if the ID provided is for a virtual server,
48+ False for a server
49+ :returns: A dictionary containing the standard virtual server firewall
50+ package
5051 """
5152
52- firewall_port_speed = self ._get_fwl_port_speed (server_id , is_cci )
53+ firewall_port_speed = self ._get_fwl_port_speed (server_id , is_virt )
5354
5455 _value = "%s%s" % (firewall_port_speed , "Mbps Hardware Firewall" )
5556 _filter = {'items' : {'description' : utils .query_filter (_value )}}
@@ -61,7 +62,8 @@ def get_dedicated_package(self, ha_enabled=False):
6162
6263 :param bool ha_enabled: True if HA is to be enabled on the firewall
6364 False for No HA
64- :returns: A dictionary containing the dedicated CCI firewall package
65+ :returns: A dictionary containing the dedicated virtual server firewall
66+ package
6567 """
6668
6769 fwl_filter = 'Hardware Firewall (Dedicated)'
@@ -87,17 +89,18 @@ def cancel_firewall(self, firewall_id, dedicated=False):
8789 billing_item = self .client ['Billing_Item' ]
8890 return billing_item .cancelService (id = billing_id )
8991
90- def add_standard_firewall (self , server_id , is_cci = True ):
91- """Creates a firewall for the specified CCI/Server .
92+ def add_standard_firewall (self , server_id , is_virt = True ):
93+ """Creates a firewall for the specified virtual/hardware server .
9294
93- :param int cci_id: The ID of the CCI to create the firewall for
94- :param bool is_cci: If false, will create the firewall for a server,
95- otherwise for a CCI
96- :returns: A dictionary containing the standard CCI firewall order
95+ :param int server_id: The ID of the server to create the firewall for
96+ :param bool is_virt: If true, will create the firewall for a virtual
97+ server, otherwise for a hardware server.
98+ :returns: A dictionary containing the standard virtual server firewall
99+ order
97100 """
98101
99- package = self .get_standard_package (server_id , is_cci )
100- if is_cci :
102+ package = self .get_standard_package (server_id , is_virt )
103+ if is_virt :
101104 product_order = {
102105 'complexType' : 'SoftLayer_Container_Product_Order_Network_'
103106 'Protection_Firewall' ,
@@ -121,7 +124,7 @@ def add_vlan_firewall(self, vlan_id, ha_enabled=False):
121124 """Creates a firewall for the specified vlan.
122125
123126 :param int vlan_id: The ID of the vlan to create the firewall for
124- :param bool ha_enabled: If True, Ha firewall will be created
127+ :param bool ha_enabled: If True, an HA firewall will be created
125128
126129 :returns: A dictionary containing the VLAN firewall order
127130 """
@@ -152,16 +155,16 @@ def _get_fwl_billing_item(self, firewall_id, dedicated=False):
152155 fwl_svc = self .client ['Network_Component_Firewall' ]
153156 return fwl_svc .getObject (id = firewall_id , mask = mask )
154157
155- def _get_fwl_port_speed (self , server_id , is_cci = True ):
158+ def _get_fwl_port_speed (self , server_id , is_virt = True ):
156159 """Determines the appropriate speed for a firewall.
157160
158161 :param int server_id: The ID of server the firewall is for
159- :param bool is_cci: true if the server_id is for a virtual server
162+ :param bool is_virt: True if the server_id is for a virtual server
160163 :returns: a integer representing the Mbps speed of a firewall
161164 """
162165
163166 fwl_port_speed = 0
164- if is_cci :
167+ if is_virt :
165168 mask = ('primaryNetworkComponent[maxSpeed]' )
166169 svc = self .client ['Virtual_Guest' ]
167170 primary = svc .getObject (mask = mask , id = server_id )
0 commit comments