libcloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pque...@apache.org
Subject svn commit: r907573 - /incubator/libcloud/trunk/libcloud/drivers/linode.py
Date Mon, 08 Feb 2010 07:26:16 GMT
Author: pquerna
Date: Mon Feb  8 07:26:16 2010
New Revision: 907573

URL: http://svn.apache.org/viewvc?rev=907573&view=rev
Log:
Signifigantly improve the randomness of the root password used by linode

Modified:
    incubator/libcloud/trunk/libcloud/drivers/linode.py

Modified: incubator/libcloud/trunk/libcloud/drivers/linode.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/libcloud/drivers/linode.py?rev=907573&r1=907572&r2=907573&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/drivers/linode.py (original)
+++ incubator/libcloud/trunk/libcloud/drivers/linode.py Mon Feb  8 07:26:16 2010
@@ -29,6 +29,7 @@
 from libcloud.base import NodeAuthPassword, NodeAuthSSHKey
 from libcloud.base import NodeImage
 from copy import copy
+import os
 
 # JSON is included in the standard library starting with Python 2.6.  For 2.5
 # and 2.4, there's a simplejson egg at: http://pypi.python.org/pypi/simplejson
@@ -285,9 +286,7 @@
 
         # Step 2: linode.disk.createfromdistribution
         if not root:
-            # Generate a random root password
-            randomness = "!(#%&" + str(Random().random()) + "sup dawg?"
-            root = sha512(randomness).hexdigest()
+            root = os.urandom(16).encode('hex')
         params = {
             "api_action":       "linode.disk.createfromdistribution",
             "LinodeID":         linode["id"],



Mime
View raw message