+ except FileExistsError: # make it idempotent
+ pass
+ except Exception as e:
+ raise FsException(str(e), http_code=HTTPStatus.INTERNAL_SERVER_ERROR)
+
+ def dir_rename(self, src, dst):
+ """
+ Rename one directory name. If dst exist, it replaces (deletes) existing directory
+ :param src: source directory
+ :param dst: destination directory
+ :return: None or raises and exception
+ """
+ try:
+ if os.path.exists(self.path + dst):
+ rmtree(self.path + dst)
+
+ os.rename(self.path + src, self.path + dst)
+