Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileNotFoundError: [Errno 2] No such file or directory: 'interfaces.infra1' #197

Closed
vikumarks opened this issue Mar 15, 2023 · 2 comments
Closed
Assignees
Labels
bug Something isn't working DENT 3.0 needed for DENT 3.0 release

Comments

@vikumarks
Copy link
Collaborator

TC: basic_triggers/test_interfaces_relaod.py::test_reload_interface

            fname = "interfaces." + dev.device_id
            old_fname = "interfaces." + dev.device_id + ".old"
            # copy the original file
            device.applog.info("Getting the original interface file")
            await device.scp(old_fname, "/etc/network/interfaces", remote_to_local=True, sudo=True)
            # copy the original file.
>           shutil.copy(fname, old_fname)

/usr/local/lib/python3.10/dist-packages/dent_os_testbed/test/test_suite/basic_triggers/test_interfaces_relaod.py:54: 
src = 'interfaces.infra1', dst = 'interfaces.infra1.old'

    def copyfile(src, dst, *, follow_symlinks=True):
        """Copy data from src to dst in the most efficient way possible.
 
        If follow_symlinks is not set and src is a symbolic link, a new
        symlink will be created instead of copying the file it points to.
 
        """
        sys.audit("shutil.copyfile", src, dst)
 
        if _samefile(src, dst):
            raise SameFileError("{!r} and {!r} are the same file".format(src, dst))
 
        file_size = 0
        for i, fn in enumerate([src, dst]):
            try:
                st = _stat(fn)
            except OSError:
                # File most likely does not exist
                pass
            else:
                # XXX What about other special files? (sockets, devices...)
                if stat.S_ISFIFO(st.st_mode):
                    fn = fn.path if isinstance(fn, os.DirEntry) else fn
                    raise SpecialFileError("`%s` is a named pipe" % fn)
                if _WINDOWS and i == 0:
                    file_size = st.st_size
 
        if not follow_symlinks and _islink(src):
            os.symlink(os.readlink(src), dst)
        else:
>           with open(src, 'rb') as fsrc:
E           FileNotFoundError: [Errno 2] No such file or directory: 'interfaces.infra1'
@mgheorghe mgheorghe added bug Something isn't working DENT 3.0 needed for DENT 3.0 release labels Mar 16, 2023
@mgheorghe
Copy link
Contributor

@muchetan
Copy link
Contributor

fixed as mentioned above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working DENT 3.0 needed for DENT 3.0 release
Projects
None yet
Development

No branches or pull requests

3 participants