#NEWLINE# def linode_set_datacenter( self , dc ) : #NEWLINE# #INDENT# 'Set the default datacenter for Linode creation\n\n        Since Linodes must be created in a facility, this function sets the\n        default that L{create_node} will use.  If a C{location} keyword is not\n        passed to L{create_node}, this method must have already been used.\n\n        @keyword dc: the datacenter to create Linodes in unless specified\n        @type dc: L{NodeLocation}' #NEWLINE# did = dc . id #NEWLINE# params = { #NEWLINE# #INDENT# 'api_action' : 'avail.datacenters' , #NEWLINE# #UNINDENT# } #NEWLINE# data = self . connection . request ( LINODE_ROOT , params = params ) . objects [ 0 ] #NEWLINE# for datacenter in data : #NEWLINE# #INDENT# if ( did == dc [ 'DATACENTERID' ] ) : #NEWLINE# #INDENT# self . datacenter = did #NEWLINE# return #NEWLINE# #UNINDENT# #UNINDENT# dcs = ', ' . join ( [ d [ 'DATACENTERID' ] for d in d ] ) #NEWLINE# self . datacenter = None #NEWLINE# raise LinodeException ( 253 , ( 'Invalid datacenter (use one of %s)' % dcs ) )