Skip to content

Commit

Permalink
[XrdCl] Support custom config file location via envar.
Browse files Browse the repository at this point in the history
- XRD_CLCONFFILE : custom user config file
- XRD_CLCONFDIR  : directory containing config files (*.conf)
  • Loading branch information
simonmichal committed Apr 28, 2021
1 parent e0af76e commit c9bed0b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/XrdCl/XrdClDefaultEnv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,24 @@ namespace XrdCl
else
log->Debug( UtilityMsg, "Unable to find user home directory." );

char *conffile = getenv( "XRD_CLCONFFILE" );
if( conffile )
{
st = Utils::ProcessConfig( userConfig, conffile );
if( !st.IsOK() )
log->Debug( UtilityMsg, "Unable to process %s file: %s",
conffile, st.ToString().c_str() );
}

char *confdir = getenv( "XRD_CLCONFDIR" );
if( confdir )
{
st = Utils::ProcessConfigDir( userConfig, confdir );
if( !st.IsOK() )
log->Debug( UtilityMsg, "Unable to process %s file: %s",
confdir, st.ToString().c_str() );
}

std::map<std::string, std::string>::iterator it;

for( it = config.begin(); it != config.end(); ++it )
Expand Down

0 comments on commit c9bed0b

Please sign in to comment.