~ubuntu-branches/debian/stretch/waagent/stretch

« back to all changes in this revision

Viewing changes to azurelinuxagent/future.py

  • Committer: Package Import Robot
  • Author(s): Bastian Blank
  • Date: 2016-02-01 13:11:28 UTC
  • mfrom: (1.2.2)
  • Revision ID: package-import@ubuntu.com-20160201131128-4wxc2tklmq3x40xe
Tags: 2.1.2-1
* New upstream version.
* Depend on host, needed by Microsofts custom script stuff.
* Use cloud-init:
  - Use Ubuntu provisioning handler, disable provisioning.
  - Depend on new enough version of cloud-init.
  - Update dependencies in init script and service.
  - Disable recursive agent invocation and hostname bounce in clout-init.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import sys
 
2
 
 
3
"""
 
4
Add alies for python2 and python3 libs and fucntions.
 
5
"""
 
6
 
 
7
if sys.version_info[0]== 3:
 
8
    import http.client as httpclient
 
9
    from urllib.parse import urlparse
 
10
    text = str
 
11
    bytebuffer = memoryview
 
12
    read_input = input
 
13
elif sys.version_info[0] == 2:
 
14
    import httplib as httpclient
 
15
    from urlparse import urlparse
 
16
    text = unicode
 
17
    bytebuffer = buffer
 
18
    read_input = raw_input
 
19
else:
 
20
    raise ImportError("Unknown python version:{0}".format(sys.version_info))
 
21