def get_tempest_default_config_dir():
 global_conf_dir = '/etc/tempest'
 xdg_config = os.environ.get('XDG_CONFIG_HOME', os.path.expanduser('~/.config'))
 user_xdg_global_path = os.path.join(xdg_config, 'tempest')
 user_global_path = os.path.join(os.path.expanduser('~'), '.tempest/etc')
 if os.path.isdir(global_conf_dir):
  return global_conf_dir
 elif os.path.isdir(user_xdg_global_path):
  return user_xdg_global_path
 elif os.path.isdir(user_global_path):
  return user_global_path
 else:
  os.makedirs(user_global_path)
  return user_global_path

def get_tempest_default_config_dir ( ) : global_conf_dir = '/etc/tempest' xdg_config = os . environ . get ( 'XDG_CONFIG_HOME' , os . path . expanduser ( '~/.config' ) ) user_xdg_global_path = os . path . join ( xdg_config , 'tempest' ) user_global_path = os . path . join ( os . path . expanduser ( '~' ) , '.tempest/etc' ) if os . path . isdir ( global_conf_dir ) : return global_conf_dir elif os . path . isdir ( user_xdg_global_path ) : return user_xdg_global_path elif os . path . isdir ( user_global_path ) : return user_global_path else : os . makedirs ( user_global_path ) return user_global_path
get default config directory of tempest there are 3 dirs that get tried in priority order .