@@ -79,8 +79,6 @@ def list_instances(self, tags=None, cpus=None, memory=None, hostname=None,
7979 ]
8080 kwargs ['mask' ] = "mask[%s]" % ',' .join (items )
8181
82- call = 'getDedicatedHosts'
83-
8482 _filter = utils .NestedDict (kwargs .get ('filter' ) or {})
8583 if tags :
8684 _filter ['dedicatedHosts' ]['tagReferences' ]['tag' ]['name' ] = {
@@ -109,8 +107,7 @@ def list_instances(self, tags=None, cpus=None, memory=None, hostname=None,
109107 utils .query_filter (datacenter ))
110108
111109 kwargs ['filter' ] = _filter .to_dict ()
112- func = getattr (self .account , call )
113- return func (** kwargs )
110+ return self .account .getDedicatedHosts (** kwargs )
114111
115112 def get_host (self , host_id , ** kwargs ):
116113 """Get details about a dedicated host.
@@ -132,22 +129,46 @@ def get_host(self, host_id, **kwargs):
132129
133130 """
134131 if 'mask' not in kwargs :
135- kwargs ['mask' ] = (
136- 'id,'
137- 'name,'
138- 'cpuCount,'
139- 'memoryCapacity,'
140- 'diskCapacity,'
141- 'createDate,'
142- 'modifyDate,'
143- 'backendRouter[id, hostname, domain],'
144- 'billingItem[id, nextInvoiceTotalRecurringAmount, '
145- 'children[categoryCode,nextInvoiceTotalRecurringAmount],'
146- 'orderItem[id, order.userRecord[username]]],'
147- 'datacenter[id, name, longName],'
148- 'guests[id, hostname, domain, uuid],'
149- 'guestCount'
150- )
132+ kwargs ['mask' ] = ('''
133+ id,
134+ name,
135+ cpuCount,
136+ memoryCapacity,
137+ diskCapacity,
138+ createDate,
139+ modifyDate,
140+ backendRouter[
141+ id,
142+ hostname,
143+ domain
144+ ],
145+ billingItem[
146+ id,
147+ nextInvoiceTotalRecurringAmount,
148+ children[
149+ categoryCode,
150+ nextInvoiceTotalRecurringAmount
151+ ],
152+ orderItem[
153+ id,
154+ order.userRecord[
155+ username
156+ ]
157+ ]
158+ ],
159+ datacenter[
160+ id,
161+ name,
162+ longName
163+ ],
164+ guests[
165+ id,
166+ hostname,
167+ domain,
168+ uuid
169+ ],
170+ guestCount
171+ ''' )
151172
152173 return self .host .getObject (id = host_id , ** kwargs )
153174
@@ -340,7 +361,7 @@ def _get_backend_router(self, locations, item):
340361
341362 raise SoftLayer .SoftLayerError ("Could not find available routers" )
342363
343- def _get_default_router (self , routers , router_name ):
364+ def _get_default_router (self , routers , router_name = None ):
344365 """Returns the default router for ordering a dedicated host."""
345366 if router_name is None :
346367 for router in routers :
0 commit comments