~lutostag/ubuntu/utopic/maas/1.5.2

« back to all changes in this revision

Viewing changes to src/provisioningserver/cobblerclient.py

  • Committer: Package Import Robot
  • Author(s): Andres Rodriguez
  • Date: 2012-04-12 16:46:22 UTC
  • mto: (20.1.1 quantal) (1.2.1)
  • mto: This revision was merged to the branch mainline in revision 14.
  • Revision ID: package-import@ubuntu.com-20120412164622-laz1qoxycfrddka0
Tags: upstream-0.1+bzr462+dfsg
ImportĀ upstreamĀ versionĀ 0.1+bzr462+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
    ]
32
32
 
33
33
from functools import partial
 
34
from urlparse import urlparse
34
35
import xmlrpclib
35
36
 
36
 
from provisioningserver.cobblercatcher import convert_cobbler_exception
 
37
from provisioningserver.cobblercatcher import (
 
38
    convert_cobbler_exception,
 
39
    ProvisioningError,
 
40
    )
37
41
from provisioningserver.enum import PSERV_FAULT
38
42
from twisted.internet import reactor as default_reactor
39
43
from twisted.internet.defer import (
41
45
    inlineCallbacks,
42
46
    returnValue,
43
47
    )
 
48
from twisted.internet.error import DNSLookupError
44
49
from twisted.python.log import msg
45
50
from twisted.web.xmlrpc import Proxy
46
51
 
248
253
                self.proxy.callRemote(method, *args))
249
254
        except xmlrpclib.Fault as e:
250
255
            raise convert_cobbler_exception(e)
 
256
        except DNSLookupError as e:
 
257
            hostname = urlparse(self.url).hostname
 
258
            raise ProvisioningError(
 
259
                faultCode=PSERV_FAULT.COBBLER_DNS_LOOKUP_ERROR,
 
260
                faultString=hostname)
251
261
        returnValue(result)
252
262
 
253
263
    @inlineCallbacks
726
736
        'mac_address',
727
737
        'profile',
728
738
        'dns_name',
 
739
        'netboot_enabled',
729
740
        ]
730
741
 
731
742
    @classmethod