def ensure_minimal_setup(package_manager):
 if (package_manager in ('dnf', 'yum')):
  return run_network_interacting_from_args(['su', 'root', '-c', [package_manager, '-y', 'install', 'sudo']])
 elif (package_manager == 'apt'):
  return sequence([run_network_interacting_from_args(['su', 'root', '-c', ['apt-get', 'update']]), run_network_interacting_from_args(['su', 'root', '-c', ['apt-get', '-y', 'install', 'sudo']])])
 else:
  raise UnsupportedDistribution()

def ensure_minimal_setup ( package_manager ) : if ( package_manager in ( 'dnf' , 'yum' ) ) : return run_network_interacting_from_args ( [ 'su' , 'root' , '-c' , [ package_manager , '-y' , 'install' , 'sudo' ] ] ) elif ( package_manager == 'apt' ) : return sequence ( [ run_network_interacting_from_args ( [ 'su' , 'root' , '-c' , [ 'apt-get' , 'update' ] ] ) , run_network_interacting_from_args ( [ 'su' , 'root' , '-c' , [ 'apt-get' , '-y' , 'install' , 'sudo' ] ] ) ] ) else : raise UnsupportedDistribution ( )
get any system into a reasonable state for installation .