def check_diskspace(repo, min_free=None):
 if (min_free is None):
  min_free = settings.get_value('PACKAGES', 'minimum_free_space', type=int, default=1)
 try:
  df = repo_run_command(repo, ('df -PB %d . | tail -1' % (10 ** 9))).stdout.split()
  free_space_gb = int(df[3])
 except Exception as e:
  raise error.RepoUnknownError(('Unknown Repo Error: %s' % e))
 if (free_space_gb < min_free):
  raise error.RepoDiskFullError(('Not enough disk space available %sg < %sg' % (free_space_gb, min_free)))

def check_diskspace ( repo , min_free = None ) : if ( min_free is None ) : min_free = settings . get_value ( 'PACKAGES' , 'minimum_free_space' , type = int , default = 1 ) try : df = repo_run_command ( repo , ( 'df -PB %d . | tail -1' % ( 10 ** 9 ) ) ) . stdout . split ( ) free_space_gb = int ( df [ 3 ] ) except Exception as e : raise error . RepoUnknownError ( ( 'Unknown Repo Error: %s' % e ) ) if ( free_space_gb < min_free ) : raise error . RepoDiskFullError ( ( 'Not enough disk space available %sg < %sg' % ( free_space_gb , min_free ) ) )
check if the remote directory over at the pkg repo has available diskspace if the amount of free space is not supplied .