incubator-tashi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strou...@apache.org
Subject svn commit: r1291421 - in /incubator/tashi/branches/stroucki-irpbugs/src/tashi/clustermanager/data: datainterface.py ldapoverride.py
Date Mon, 20 Feb 2012 19:52:21 GMT
Author: stroucki
Date: Mon Feb 20 19:52:20 2012
New Revision: 1291421

URL: http://svn.apache.org/viewvc?rev=1291421&view=rev
Log:
ldapoverride: give getImages to ldap. This should be cleaned eventually.
datainterface: define getImages as rpc

Modified:
    incubator/tashi/branches/stroucki-irpbugs/src/tashi/clustermanager/data/datainterface.py
    incubator/tashi/branches/stroucki-irpbugs/src/tashi/clustermanager/data/ldapoverride.py

Modified: incubator/tashi/branches/stroucki-irpbugs/src/tashi/clustermanager/data/datainterface.py
URL: http://svn.apache.org/viewvc/incubator/tashi/branches/stroucki-irpbugs/src/tashi/clustermanager/data/datainterface.py?rev=1291421&r1=1291420&r2=1291421&view=diff
==============================================================================
--- incubator/tashi/branches/stroucki-irpbugs/src/tashi/clustermanager/data/datainterface.py
(original)
+++ incubator/tashi/branches/stroucki-irpbugs/src/tashi/clustermanager/data/datainterface.py
Mon Feb 20 19:52:20 2012
@@ -45,6 +45,9 @@ class DataInterface(object):
 	
 	def getHost(self, id):
 		raise NotImplementedError
+
+	def getImages(self):
+		raise NotImplementedError
 	
 	def getInstances(self):
 		raise NotImplementedError

Modified: incubator/tashi/branches/stroucki-irpbugs/src/tashi/clustermanager/data/ldapoverride.py
URL: http://svn.apache.org/viewvc/incubator/tashi/branches/stroucki-irpbugs/src/tashi/clustermanager/data/ldapoverride.py?rev=1291421&r1=1291420&r2=1291421&view=diff
==============================================================================
--- incubator/tashi/branches/stroucki-irpbugs/src/tashi/clustermanager/data/ldapoverride.py
(original)
+++ incubator/tashi/branches/stroucki-irpbugs/src/tashi/clustermanager/data/ldapoverride.py
Mon Feb 20 19:52:20 2012
@@ -17,6 +17,8 @@
 
 import subprocess
 import time
+#XXXstroucki getImages requires os?
+import os
 from tashi.rpycservices.rpyctypes import User
 from tashi.clustermanager.data import DataInterface
 from tashi.util import instantiateImplementation
@@ -68,6 +70,17 @@ class LdapOverride(DataInterface):
 	def getNetwork(self, id):
 		return self.baseDataObject.getNetwork(id)
 
+        def getImages(self):
+                count = 0
+                myList = []
+                for i in self.dfs.list("images"):
+                        myFile = self.dfs.getLocalHandle("images/" + i)
+                        if os.path.isfile(myFile):
+                                image = LocalImages(d={'id':count, 'imageName':i, 'imageSize':humanReadable(self.dfs.stat(myFile)[6])})
+                                myList.append(image)
+                                count += 1
+                return myList
+
 	def fetchFromLdap(self):
 		now = time.time()
 		if (now - self.lastUserUpdate > self.fetchThreshold):



Mime
View raw message