~ubuntu-branches/debian/sid/waagent/sid

« back to all changes in this revision

Viewing changes to azurelinuxagent/pa/provision/ubuntu.py

  • Committer: Package Import Robot
  • Author(s): Bastian Blank
  • Date: 2016-10-05 14:10:15 UTC
  • mfrom: (1.2.6)
  • Revision ID: package-import@ubuntu.com-20161005141015-qufn5j541xvy9cpe
Tags: 2.2.0-1
New upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
"""
33
33
On ubuntu image, provision could be disabled.
34
34
"""
 
35
 
 
36
 
35
37
class UbuntuProvisionHandler(ProvisionHandler):
36
38
    def __init__(self):
37
39
        super(UbuntuProvisionHandler, self).__init__()
38
40
 
39
41
    def run(self):
40
 
        #If provision is enabled, run default provision handler
 
42
        # If provision is enabled, run default provision handler
41
43
        if conf.get_provision_enabled():
42
44
            super(UbuntuProvisionHandler, self).run()
43
45
            return
49
51
 
50
52
        logger.info("Waiting cloud-init to copy ovf-env.xml.")
51
53
        self.wait_for_ovfenv()
52
 
 
53
 
        protocol = self.protocol_util.get_protocol()
 
54
        self.protocol_util.get_protocol()
54
55
        self.report_not_ready("Provisioning", "Starting")
55
56
        logger.info("Sleep 15 seconds to prevent throttling")
56
 
        time.sleep(15) #Sleep to prevent throttling
 
57
        time.sleep(15)  # Sleep to prevent throttling
 
58
 
57
59
        try:
58
60
            logger.info("Wait for ssh host key to be generated.")
59
61
            thumbprint = self.wait_for_ssh_host_key()
60
62
            fileutil.write_file(provisioned, "")
61
63
            logger.info("Finished provisioning")
62
 
           
63
64
        except ProvisionError as e:
64
65
            logger.error("Provision failed: {0}", e)
65
66
            self.report_not_ready("ProvisioningFailed", ustr(e))
66
67
            self.report_event(ustr(e))
67
68
            return
68
 
            
 
69
 
69
70
        self.report_ready(thumbprint)
70
71
        self.report_event("Provision succeed", is_success=True)
71
72