The reason behind this change is that FSMongo needs to sync the charm to the local storage in order for libjuju to reach it.
Change-Id: Ic5838fd4ab64dd2c3e2cf78c439f33363885dd14
Signed-off-by: David Garcia <david.garcia@canonical.com>
def file_delete(self, storage, ignore_non_exist=False):
raise FsException("Method 'file_delete' not implemented")
+
+ def sync(self):
+ raise FsException("Method 'sync' not implemented")
raise FsException("File {} does not exist".format(storage), http_code=HTTPStatus.NOT_FOUND)
except (IOError, PermissionError) as e:
raise FsException("File {} cannot be deleted: {}".format(f, e), http_code=HTTPStatus.INTERNAL_SERVER_ERROR)
+
+ def sync(self):
+ pass # Not needed in fslocal
os.chmod(file_path, writing_file.metadata["permissions"])
def get_params(self):
- self.__update_local_fs()
-
return {"fs": "mongo", "path": self.path}
def fs_connect(self, config):
raise FsException("File {} does not exist".format(storage), http_code=HTTPStatus.NOT_FOUND)
except IOError as e:
raise FsException("File {} cannot be deleted: {}".format(f, e), http_code=HTTPStatus.INTERNAL_SERVER_ERROR)
+
+ def sync(self):
+ """
+ Sync from FSMongo to local storage
+ """
+ self.__update_local_fs()