Precedence of XML file parameters, command-line options, and environment variables

You can control the utility in multiple ways. Precedence determines which method actually affects the utility.

The agent update and deployment utility provides the following methods, in order of precedence, for controlling its behavior:

  1. Parameter in <Target> element
  2. Command-line option
  3. Parameter in <Globals> element
  4. Environment variable

The utility considers each method in order. If a method is defined with a valid value, the utility uses that value and ignores all following methods.

Example

This example describes how the utility locates the installer. The <Target> and <Globals> elements both have defined SourceDirectory parameters. These parameters indicate possible locations of the installer. However, the utility has several locations to check. As soon as the utility finds the installer, the utility uses the installer.

  1. The utility first checks the parameter in the <Target> element. If the ..\test\wind directory exists, the utility checks for the installer in that directory. If the installer is in that directory, the utility uses that installer.
  2. If the directory does not exist or does not contain the installer, the utility checks whether the -sourceDir command-line option was specified. If the option was specified with a valid directory, the utility checks that directory and uses the installer from that directory.
  3. If -sourceDir was not specified, the directory was not valid, or the directory did not contain the installer, the utility checks the parameter in the <Globals> element. Now the utility checks the ..\test directory.
  4. If ..\test directory does not produce the installer, the utility checks the SOURCEDIR environment variable. If that directory does not exist or does not contain the installer, the utility generates an error.
<?xml version="1.0" encoding="UTF-8"?>
<AgentDeploymentAndUpdate>

<Globals>
<Parameter Name="SourceDirectory" Value="..\test"/>
<Parameter Name="KeyFile" Value="..\test\keyfile.txt"/>
</Globals>

<Target id="9.164.102.169">
<Parameter Name="SourceDirectory" Value="..\test\wind"/>
<Parameter Name="ConnectionType" Value="ssh"/>
<Parameter Name="UserName" Value="root"/>
<Parameter Name="Password" Value="toor123"/>
<Parameter Name="ExistingAgentPath" Value="/usr/local/bin/bfagent"/>
<Parameter Name="AgentInstallLocation" Value="/usr/local/bin/bfagent"/>
</Target>

</AgentDeploymentAndUpdate>

Feedback