summaryrefslogtreecommitdiff
path: root/azurelinuxagent/utils/textutil.py
diff options
context:
space:
mode:
authorBen Howard <ben.howard@ubuntu.com>2015-12-07 16:48:51 -0700
committerusd-importer <ubuntu-server@lists.ubuntu.com>2015-12-08 16:10:11 +0000
commit83432149e212155469b1e9f06eb0095121377356 (patch)
tree9029a2e7836dce3025d5c5a6527d74bbf8d799e5 /azurelinuxagent/utils/textutil.py
parent04946cba49f19c0b6b876bccdbb36d47334af002 (diff)
downloadvyos-walinuxagent-83432149e212155469b1e9f06eb0095121377356.tar.gz
vyos-walinuxagent-83432149e212155469b1e9f06eb0095121377356.zip
Import patches-unapplied version 2.1.2-0ubuntu1 to ubuntu/xenial-proposed
Imported using git-ubuntu import. Changelog parent: 04946cba49f19c0b6b876bccdbb36d47334af002 New changelog entries: * New upstream release (LP: #1523715): - Bug fixes for Ubuntu 15.10 on Azure - Enablement for Azure Stack - Dropped patch for systemd job as upstream now includes it.
Diffstat (limited to 'azurelinuxagent/utils/textutil.py')
-rw-r--r--azurelinuxagent/utils/textutil.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/azurelinuxagent/utils/textutil.py b/azurelinuxagent/utils/textutil.py
index 2e66b0e..e0f1395 100644
--- a/azurelinuxagent/utils/textutil.py
+++ b/azurelinuxagent/utils/textutil.py
@@ -1,4 +1,4 @@
-# Windows Azure Linux Agent
+# Microsoft Azure Linux Agent
#
# Copyright 2014 Microsoft Corporation
#
@@ -22,6 +22,7 @@ import string
import struct
import xml.dom.minidom as minidom
import sys
+from distutils.version import LooseVersion
def parse_doc(xml_text):
"""
@@ -217,12 +218,11 @@ def remove_bom(c):
c = c[3:]
return c
-def gen_password_hash(password, use_salt, salt_type, salt_len):
- salt="$6$"
- if use_salt:
- collection = string.ascii_letters + string.digits
- salt = ''.join(random.choice(collection) for _ in range(salt_len))
- salt = "${0}${1}".format(salt_type, salt)
+def gen_password_hash(password, crypt_id, salt_len):
+ collection = string.ascii_letters + string.digits
+ salt = ''.join(random.choice(collection) for _ in range(salt_len))
+ salt = "${0}${1}".format(crypt_id, salt)
return crypt.crypt(password, salt)
+Version = LooseVersion