@@ -129,7 +129,7 @@ def get_all_dsf_monitors():
129129def _checkType (service ):
130130 if isinstance (service , TrafficDirector ):
131131 _service_id = service .service_id
132- elif type (service ) is str :
132+ elif type (service ) is str or type ( service ) is unicode :
133133 _service_id = service
134134 else :
135135 raise Exception ('Value must be string, or TrafficDirector Object' )
@@ -309,7 +309,7 @@ def add_to_record_set(self, record_set, service = None, publish = True):
309309 if isinstance (record_set , DSFRecordSet ):
310310 _record_set_id = record_set ._dsf_record_set_id
311311 _service_id = record_set ._service_id
312- elif type (record_set ) is str :
312+ elif type (record_set ) is str or type ( record_set ) is unicode :
313313 if service is None :
314314 raise Exception ('When record_set as a string, you must provide the service_id as service=' )
315315 _record_set_id = record_set
@@ -1549,7 +1549,7 @@ def add_to_failover_chain(self, failover_chain, service=None, publish=True):
15491549 if isinstance (failover_chain , DSFFailoverChain ):
15501550 _dsf_record_set_failover_chain_id = failover_chain ._dsf_record_set_failover_chain_id
15511551 _service_id = failover_chain ._service_id
1552- elif type (failover_chain ) is str :
1552+ elif type (failover_chain ) is str or type ( failover_chain ) is unicode :
15531553 if service is None :
15541554 raise Exception ('If passing failover_chain as a string, you must provide the service_id as service=' )
15551555 _dsf_record_set_failover_chain_id = failover_chain
@@ -1715,7 +1715,7 @@ def set_monitor(self, monitor):
17151715 """
17161716 if isinstance (monitor , DSFMonitor ):
17171717 _monitor_id = monitor ._dsf_monitor_id
1718- elif type (monitor ) is str :
1718+ elif type (monitor ) is str or type ( monitor ) is unicode :
17191719 _monitor_id = monitor
17201720 else :
17211721 raise Exception ('Could not make sense of Monitor Type' )
@@ -1919,7 +1919,7 @@ def add_to_response_pool(self, response_pool, service=None, publish=True):
19191919 if isinstance (response_pool , DSFResponsePool ):
19201920 _response_pool_id = response_pool ._dsf_response_pool_id
19211921 _service_id = response_pool ._service_id
1922- elif type (response_pool ) is str :
1922+ elif type (response_pool ) is str or type ( response_pool ) is unicode :
19231923 if service is None :
19241924 raise Exception ('If passing response_pool as a string, you must provide the service_id as service=' )
19251925 _response_pool_id = response_pool
@@ -2397,7 +2397,7 @@ def add_response_pool(self, response_pool, index=0, publish=True):
23972397 """
23982398 if isinstance (response_pool , DSFResponsePool ):
23992399 _response_pool_id = response_pool ._dsf_response_pool_id
2400- elif type (response_pool ) is str :
2400+ elif type (response_pool ) is str or type ( response_pool ) is unicode :
24012401 _response_pool_id = response_pool
24022402 else :
24032403 raise Exception ('Could not make sense of Response Pool Type' )
@@ -2426,7 +2426,7 @@ def remove_response_pool(self, response_pool, publish=True):
24262426 if isinstance (response_pool , DSFResponsePool ):
24272427 _response_pool_id = response_pool ._dsf_response_pool_id
24282428 _service_id = response_pool ._service_id
2429- elif type (response_pool ) is str :
2429+ elif type (response_pool ) is str or type ( response_pool ) is unicode :
24302430 _response_pool_id = response_pool
24312431 else :
24322432 raise Exception ('Could not make sense of Response Pool Type' )
@@ -2471,7 +2471,7 @@ def order_response_pools(self, pool_list, publish=True):
24712471 for list_item in pool_list :
24722472 if isinstance (list_item , DSFResponsePool ):
24732473 _pool_list .append (list_item ._dsf_response_pool_id )
2474- elif type (list_item ) is str :
2474+ elif type (list_item ) is str or type ( list_item ) is unicode :
24752475 _pool_list .append (list_item )
24762476 api_args = dict ()
24772477 api_args ['response_pools' ] = list ()
0 commit comments