diff --git a/manila/utils.py b/manila/utils.py index 5a77c01fb9..61fb2835fd 100644 --- a/manila/utils.py +++ b/manila/utils.py @@ -219,18 +219,6 @@ class LazyPluggable(object): return getattr(backend, key) -def delete_if_exists(pathname): - """Delete a file, but ignore file not found error.""" - - try: - os.unlink(pathname) - except OSError as e: - if e.errno == errno.ENOENT: - return - else: - raise - - def get_from_path(items, path): """Returns a list of items matching the specified path. @@ -476,21 +464,6 @@ def walk_class_hierarchy(clazz, encountered=None): yield subclass -def ensure_tree(path): - """Create a directory (and any ancestor directories required) - - :param path: Directory to create - """ - try: - os.makedirs(path) - except OSError as exc: - if exc.errno == errno.EEXIST: - if not os.path.isdir(path): - raise - else: - raise - - def cidr_to_netmask(cidr): """Convert cidr to netmask.""" try: