def __init__(self): self._log = fgLog.fgLog(IRUtil.getLogFile(), IRUtil.getLogLevel(), "getDistributions", False) self.returnCode = 0 kernel = self.runCmd('uname -s') if kernel == "Darwin\n" : self._log.info("Using Darwin kernel ") self.openssl_dist = 'http://www.openssl.org/source/openssl-1.0.0d.tar.gz' self.openssl_dir = 'openssl-1.0.0d' self.cherrypy_dist = 'http://download.cherrypy.org/cherrypy/3.2.0/CherryPy-3.2.0.tar.gz' self.cherrypy_dir = 'CherryPy-3.2.0' cmdOutput = 'x86_64\n'#runCmd('uname -p') if cmdOutput == "i386\n" : self.mongo_dist = 'http://fastdl.mongodb.org/osx/mongodb-osx-i386-1.8.2.tgz' self.mongo_dir = 'mongodb-osx-i386-1.8.2' elif cmdOutput == 'x86_64\n' : self._log.info('Using osx x86_64') self.mongo_dist = 'http://fastdl.mongodb.org/osx/mongodb-osx-x86_64-1.8.2.tgz' self.mongo_dir = 'mongodb-osx-x86_64-1.8.2' elif kernel == "Linux\n" : self.info('Using Linux kernel') self.openssl_dist = 'http://www.openssl.org/source/openssl-1.0.0d.tar.gz' self.openssl_dir = 'openssl-1.0.0d' self.cherrypy_dist = 'http://download.cherrypy.org/cherrypy/3.2.0/CherryPy-3.2.0.tar.gz' self.cherrypy_dir = 'CherryPy-3.2.0' cmdOutput = 'x86_64\n' #runCmd('uname -p') if cmdOutput == "i386\n" : self.mongo_dist = 'http://fastdl.mongodb.org/linux/mongodb-linux-i686-1.8.2.tgz' self.mongo_dir = 'mongodb-linux-i686-1.8.2' elif cmdOutput == "x86_64\n" : self.mongo_dist = 'http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-1.8.2.tgz' self.mongo_dir = 'mongodb-linux-x86_64-1.8.2'
def __init__(self): super(IRService, self).__init__() #Config in IRUtil self._backend = IRUtil.getBackend() self._address = IRUtil.getAddress() self._fgirimgstore = IRUtil.getFgirimgstore() self._fgserverdir = IRUtil.getFgserverdir() #Setup log self._log = fgLog.fgLog(IRUtil.getLogFile(), IRUtil.getLogLevel(), "Img Repo Server", True) if (self._backend == "mongodb"): self.metaStore = ImgMetaStoreMongo(self._address, self._fgserverdir, self._log) self.imgStore = ImgStoreMongo(self._address, self._fgserverdir, self._log) self.userStore = IRUserStoreMongo(self._address, self._fgserverdir, self._log) elif(self._backend == "mysql"): self.metaStore = ImgMetaStoreMysql(self._address, self._fgserverdir, self._log) self.imgStore = ImgStoreMysql(self._address, self._fgserverdir, self._log) self.userStore = IRUserStoreMysql(self._address, self._fgserverdir, self._log) elif(self._backend == "swiftmysql"): self.metaStore = ImgMetaStoreSwiftMysql(self._address, self._fgserverdir, self._log) self.imgStore = ImgStoreSwiftMysql(self._address, IRUtil.getAddressS(), self._fgserverdir, self._log) self.userStore = IRUserStoreSwiftMysql(self._address, self._fgserverdir, self._log) elif(self._backend == "swiftmongo"): self.metaStore = ImgMetaStoreSwiftMongo(self._address, self._fgserverdir, self._log) self.imgStore = ImgStoreSwiftMongo(self._address, IRUtil.getAddressS(), self._fgserverdir, self._log) self.userStore = IRUserStoreSwiftMongo(self._address, self._fgserverdir, self._log) elif(self._backend == "cumulusmysql"): self.metaStore = ImgMetaStoreCumulusMysql(self._address, self._fgserverdir, self._log) self.imgStore = ImgStoreCumulusMysql(self._address, IRUtil.getAddressS(), self._fgserverdir, self._log) self.userStore = IRUserStoreCumulusMysql(self._address, self._fgserverdir, self._log) elif(self._backend == "cumulusmongo"): self.metaStore = ImgMetaStoreCumulusMongo(self._address, self._fgserverdir, self._log) self.imgStore = ImgStoreCumulusMongo(self._address, IRUtil.getAddressS(), self._fgserverdir, self._log) self.userStore = IRUserStoreCumulusMongo(self._address, self._fgserverdir, self._log) else: self.metaStore = ImgMetaStoreFS() self.imgStore = ImgStoreFS() self.userStore = IRUserStoreFS()