X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_common%2Ffsmongo.py;h=2b67cf39511d2ca13175efc2a72f7e82186d2f7b;hb=refs%2Fchanges%2F22%2F13122%2F2;hp=1ce59097b7110f39f13afee4f4c0a9c5e44bec54;hpb=3dd0db6efaab109fa1bd43395fbbddecf1eb73d4;p=osm%2Fcommon.git diff --git a/osm_common/fsmongo.py b/osm_common/fsmongo.py index 1ce5909..2b67cf3 100644 --- a/osm_common/fsmongo.py +++ b/osm_common/fsmongo.py @@ -275,14 +275,11 @@ class FsMongo(FsBase): if all(key in config.keys() for key in ["uri", "collection"]): self.client = MongoClient(config["uri"]) self.fs = GridFSBucket(self.client[config["collection"]]) - elif all(key in config.keys() for key in ["host", "port", "collection"]): - self.client = MongoClient(config["host"], config["port"]) - self.fs = GridFSBucket(self.client[config["collection"]]) else: if "collection" not in config.keys(): raise FsException('Missing parameter "collection"') else: - raise FsException('Missing parameters: "uri" or "host" + "port"') + raise FsException('Missing parameters: "uri"') except FsException: raise except Exception as e: # TODO refine @@ -573,7 +570,6 @@ class FsMongo(FsBase): self.__update_local_fs(from_path=from_path) def _update_mongo_fs(self, from_path): - os_path = self.path + from_path # Obtain list of files and dirs in filesystem @@ -618,7 +614,6 @@ class FsMongo(FsBase): remote_files.pop(rel_filename, None) if last_modified_date >= upload_date: - stream = None fh = None try: @@ -655,7 +650,6 @@ class FsMongo(FsBase): self.fs.delete(file._id) def _get_mongo_files(self, from_path=None): - file_dict = {} file_cursor = self.fs.find(no_cursor_timeout=True, sort=[("uploadDate", -1)]) for file in file_cursor: