def create_symlink()

in airavata_django_portal_sdk/user_storage/backends/django_filesystem_provider.py [0:0]


    def create_symlink(self, source_path, dest_path):
        datastore = self.datastore
        if (datastore.symlink_exists(dest_path) and
                os.path.realpath(source_path) == os.path.realpath(datastore.path(dest_path))):
            logger.debug(f"symlink at {dest_path} already points to {source_path}")
            return
        elif datastore.exists(dest_path):
            raise Exception(f"{dest_path} already exists, but isn't the expected symlink")
        else:
            datastore.create_symlink(source_path, dest_path)