@pytest.fixture(scope='session', autouse=True)
def allow_sudo_user(setup_package):
 from fabtools.require import file as require_file
 require_file('/etc/sudoers.d/fabtools', contents='vagrant ALL=(ALL) NOPASSWD:ALL\n', owner='root', mode='440', use_sudo=True)

@ pytest . fixture ( scope = 'session' , autouse = True ) def allow_sudo_user ( setup_package ) : from fabtools . require import file as require_file require_file ( '/etc/sudoers.d/fabtools' , contents = 'vagrant ALL=(ALL) NOPASSWD:ALL\n' , owner = 'root' , mode = '440' , use_sudo = True )
fix sudo config if needed some vagrant boxes come with a too restrictive sudoers config and only allow the vagrant user to run commands as root .