|
@@ -27,87 +27,162 @@
|
|
|
|
|
|
<xsl:template match="BackupNodeProcess">
|
|
|
<xsl:if test="@name = $process">
|
|
|
- <xsl:text>
</xsl:text>
|
|
|
- <xsl:text>[default]</xsl:text>
|
|
|
- <xsl:text>
</xsl:text>
|
|
|
- <xsl:text>thorlist=</xsl:text>
|
|
|
- <xsl:call-template name="getThorClusterList"/>
|
|
|
- <xsl:call-template name="getThorClusterDetails"/>
|
|
|
+ <xsl:call-template name="printHeader">
|
|
|
+ <xsl:with-param name="header" select="'default'"/>
|
|
|
+ </xsl:call-template>
|
|
|
+ <xsl:call-template name="printVariable">
|
|
|
+ <xsl:with-param name="var" select="'thorlist'"/>
|
|
|
+ <xsl:with-param name="val">
|
|
|
+ <xsl:call-template name="getNodeList"/>
|
|
|
+ </xsl:with-param>
|
|
|
+ </xsl:call-template>
|
|
|
+ <xsl:call-template name="printClusterDetails"/>
|
|
|
</xsl:if>
|
|
|
</xsl:template>
|
|
|
|
|
|
- <!--getThorClusterList-->
|
|
|
- <xsl:template name="getThorClusterList">
|
|
|
- <xsl:for-each select="/Environment/Software/BackupNodeProcess/NodeGroup">
|
|
|
- <xsl:value-of select="@name"/>
|
|
|
- <xsl:if test="position() != last()">
|
|
|
- <xsl:text>,</xsl:text>
|
|
|
- </xsl:if>
|
|
|
- </xsl:for-each>
|
|
|
+ <!-- getNodeList
|
|
|
+ return NodeGroups in csv list
|
|
|
+ -->
|
|
|
+ <xsl:template name="getNodeList">
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="NodeGroup">
|
|
|
+ <xsl:for-each select="NodeGroup">
|
|
|
+ <xsl:variable name="nodeName" select="@name"/>
|
|
|
+ <xsl:for-each select="/Environment/Software/ThorCluster">
|
|
|
+ <xsl:if test="($nodeName = @name) and (((@localThor = 'false' or not(@localThor)) and not(@nodeGroup)) or (@nodeGroup = @name))">
|
|
|
+ <xsl:value-of select="@name"/><xsl:text>,</xsl:text>
|
|
|
+ </xsl:if>
|
|
|
+ </xsl:for-each>
|
|
|
+ </xsl:for-each>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:otherwise>
|
|
|
+ <xsl:for-each select="/Environment/Software/ThorCluster">
|
|
|
+ <xsl:if test="((@localThor = 'false' or not(@localThor)) and not(@nodeGroup)) or (@nodeGroup = @name)">
|
|
|
+ <xsl:value-of select="@name"/><xsl:text>,</xsl:text>
|
|
|
+ </xsl:if>
|
|
|
+ </xsl:for-each>
|
|
|
+ </xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
</xsl:template>
|
|
|
- <!--getThorClusterList-->
|
|
|
+ <!-- getNodeList -->
|
|
|
+
|
|
|
+ <xsl:template name="printClusterDetails">
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="NodeGroup">
|
|
|
+ <xsl:for-each select="NodeGroup">
|
|
|
+ <xsl:variable name="nodeName" select="@name"/>
|
|
|
+ <xsl:variable name="interval" select="@interval"/>
|
|
|
+ <xsl:for-each select="/Environment/Software/ThorCluster[@name=$nodeName]">
|
|
|
+ <xsl:if test="((@localThor = 'false' or not(@localThor)) and not(@nodeGroup)) or (@nodeGroup = @name)">
|
|
|
+ <xsl:call-template name="getThorClusterDetails">
|
|
|
+ <xsl:with-param name="interval" select="$interval"/>
|
|
|
+ </xsl:call-template>
|
|
|
+ </xsl:if>
|
|
|
+ </xsl:for-each>
|
|
|
+ </xsl:for-each>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:otherwise>
|
|
|
+ <xsl:for-each select="/Environment/Software/ThorCluster">
|
|
|
+ <xsl:if test="((@localThor = 'false' or not(@localThor)) and not(@nodeGroup)) or (@nodeGroup = @name)">
|
|
|
+ <xsl:call-template name="getThorClusterDetails">
|
|
|
+ </xsl:call-template>
|
|
|
+ </xsl:if>
|
|
|
+ </xsl:for-each>
|
|
|
+ </xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+ </xsl:template>
|
|
|
+
|
|
|
|
|
|
<!--getThorClusterDetails-->
|
|
|
+ <!--
|
|
|
+ [header]
|
|
|
+ interval
|
|
|
+ daliserver
|
|
|
+ localthor
|
|
|
+ thormaster
|
|
|
+ thorprimary
|
|
|
+ thorname
|
|
|
+ SSHidentityfile
|
|
|
+ SSHusername
|
|
|
+ SSHpassword
|
|
|
+ SSHtimeout
|
|
|
+ SSHretries
|
|
|
+ -->
|
|
|
<xsl:template name="getThorClusterDetails">
|
|
|
- <xsl:for-each select="/Environment/Software/BackupNodeProcess/NodeGroup">
|
|
|
- <xsl:variable name="name" select="@name"/>
|
|
|
- <!--header-->
|
|
|
- <xsl:text>
</xsl:text>
|
|
|
- <xsl:text>[</xsl:text>
|
|
|
- <xsl:value-of select="@name"/>
|
|
|
- <xsl:text>]</xsl:text>
|
|
|
- <!--interval-->
|
|
|
- <xsl:text>
</xsl:text>
|
|
|
- <xsl:text>interval=</xsl:text>
|
|
|
- <xsl:value-of select="@interval"/>
|
|
|
- <!--daliserver-->
|
|
|
- <xsl:text>
</xsl:text>
|
|
|
- <xsl:text>daliserver=</xsl:text>
|
|
|
- <xsl:call-template name="getDaliServers">
|
|
|
- <xsl:with-param name="daliServer" select="/Environment/Software/ThorCluster[@name=$name]/@daliServers"/>
|
|
|
- </xsl:call-template>
|
|
|
- <!--localthor-->
|
|
|
- <xsl:text>
</xsl:text>
|
|
|
- <xsl:text>localthor=</xsl:text>
|
|
|
- <xsl:value-of select="/Environment/Software/ThorCluster[@name=$name]/@localThor"/>
|
|
|
- <!--thormaster-->
|
|
|
- <xsl:text>
</xsl:text>
|
|
|
- <xsl:text>thormaster=</xsl:text>
|
|
|
- <xsl:call-template name="getNetAddress">
|
|
|
- <xsl:with-param name="computer" select="/Environment/Software/ThorCluster[@name=$name]/ThorMasterProcess/@computer"/>
|
|
|
- </xsl:call-template>
|
|
|
- <!--thorprimary-->
|
|
|
- <xsl:text>
</xsl:text>
|
|
|
- <xsl:text>thorprimary=</xsl:text>
|
|
|
- <xsl:value-of select="/Environment/Software/ThorCluster[@name=$name]/@nodeGroup"/>
|
|
|
- <!--thorname-->
|
|
|
- <xsl:text>
</xsl:text>
|
|
|
- <xsl:text>thorname=</xsl:text>
|
|
|
- <xsl:value-of select="@name"/>
|
|
|
- <!--SSHidentityfile-->
|
|
|
- <xsl:text>
</xsl:text>
|
|
|
- <xsl:text>SSHidentityfile=</xsl:text>
|
|
|
- <xsl:value-of select="/Environment/Software/ThorCluster[@name=$name]/SSH/@SSHidentityfile"/>
|
|
|
- <!--SSHusername-->
|
|
|
- <xsl:text>
</xsl:text>
|
|
|
- <xsl:text>SSHusername=</xsl:text>
|
|
|
- <xsl:value-of select="/Environment/Software/ThorCluster[@name=$name]/SSH/@SSHusername"/>
|
|
|
- <!--SSHpassword-->
|
|
|
- <xsl:text>
</xsl:text>
|
|
|
- <xsl:text>SSHpassword=</xsl:text>
|
|
|
- <xsl:value-of select="/Environment/Software/ThorCluster[@name=$name]/SSH/@SSHpassword"/>
|
|
|
- <!--SSHtimeout-->
|
|
|
- <xsl:text>
</xsl:text>
|
|
|
- <xsl:text>SSHtimeout=</xsl:text>
|
|
|
- <xsl:value-of select="/Environment/Software/ThorCluster[@name=$name]/SSH/@SSHtimeout"/>
|
|
|
- <!--SSHretries-->
|
|
|
- <xsl:text>
</xsl:text>
|
|
|
- <xsl:text>SSHretries=</xsl:text>
|
|
|
- <xsl:value-of select="/Environment/Software/ThorCluster[@name=$name]/SSH/@SSHretries"/>
|
|
|
- </xsl:for-each>
|
|
|
+ <xsl:param name="interval" select="12"/>
|
|
|
+ <xsl:call-template name="printHeader">
|
|
|
+ <xsl:with-param name="header" select="@name"/>
|
|
|
+ </xsl:call-template>
|
|
|
+ <xsl:call-template name="printVariable">
|
|
|
+ <xsl:with-param name="var" select="'interval'"/>
|
|
|
+ <xsl:with-param name="val" select="$interval"/>
|
|
|
+ </xsl:call-template>
|
|
|
+ <xsl:call-template name="printVariable">
|
|
|
+ <xsl:with-param name="var" select="'daliserver'"/>
|
|
|
+ <xsl:with-param name="val">
|
|
|
+ <xsl:call-template name="getDaliServers">
|
|
|
+ <xsl:with-param name="daliServer" select="@daliServers"/>
|
|
|
+ </xsl:call-template>
|
|
|
+ </xsl:with-param>
|
|
|
+ </xsl:call-template>
|
|
|
+ <xsl:call-template name="printVariable">
|
|
|
+ <xsl:with-param name="var" select="'localthor'"/>
|
|
|
+ <xsl:with-param name="val" select="@localThor"/>
|
|
|
+ </xsl:call-template>
|
|
|
+ <xsl:call-template name="printVariable">
|
|
|
+ <xsl:with-param name="var" select="'thormaster'"/>
|
|
|
+ <xsl:with-param name="val">
|
|
|
+ <xsl:call-template name="getNetAddress">
|
|
|
+ <xsl:with-param name="computer" select="ThorMasterProcess/@computer"/>
|
|
|
+ </xsl:call-template>
|
|
|
+ </xsl:with-param>
|
|
|
+ </xsl:call-template>
|
|
|
+ <xsl:call-template name="printVariable">
|
|
|
+ <xsl:with-param name="var" select="'thorprimary'"/>
|
|
|
+ <xsl:with-param name="val" select="@nodeGroup"/>
|
|
|
+ </xsl:call-template>
|
|
|
+ <xsl:call-template name="printVariable">
|
|
|
+ <xsl:with-param name="var" select="'thorname'"/>
|
|
|
+ <xsl:with-param name="val" select="@name"/>
|
|
|
+ </xsl:call-template>
|
|
|
+ <xsl:call-template name="printVariable">
|
|
|
+ <xsl:with-param name="var" select="'SSHidentityfile'"/>
|
|
|
+ <xsl:with-param name="val" select="SSH/@SSHidentityfile"/>
|
|
|
+ </xsl:call-template>
|
|
|
+ <xsl:call-template name="printVariable">
|
|
|
+ <xsl:with-param name="var" select="'SSHusername'"/>
|
|
|
+ <xsl:with-param name="val" select="SSH/@SSHusername"/>
|
|
|
+ </xsl:call-template>
|
|
|
+ <xsl:call-template name="printVariable">
|
|
|
+ <xsl:with-param name="var" select="'SSHpassword'"/>
|
|
|
+ <xsl:with-param name="val" select="SSH/@SSHpassword"/>
|
|
|
+ </xsl:call-template>
|
|
|
+ <xsl:call-template name="printVariable">
|
|
|
+ <xsl:with-param name="var" select="'SSHtimeout'"/>
|
|
|
+ <xsl:with-param name="val" select="SSH/@SSHtimeout"/>
|
|
|
+ </xsl:call-template>
|
|
|
+ <xsl:call-template name="printVariable">
|
|
|
+ <xsl:with-param name="var" select="'SSHretries'"/>
|
|
|
+ <xsl:with-param name="val" select="SSH/@SSHretries"/>
|
|
|
+ </xsl:call-template>
|
|
|
</xsl:template>
|
|
|
<!--getThorClusterDetails-->
|
|
|
|
|
|
+ <!-- printHeader -->
|
|
|
+ <xsl:template name="printHeader">
|
|
|
+ <xsl:param name="header"/>
|
|
|
+ <xsl:text>[</xsl:text><xsl:value-of select="$header"/><xsl:text>]
</xsl:text>
|
|
|
+ </xsl:template>
|
|
|
+ <!-- printHeader -->
|
|
|
+
|
|
|
+ <!-- printVariable -->
|
|
|
+ <xsl:template name="printVariable">
|
|
|
+ <xsl:param name="var"/>
|
|
|
+ <xsl:param name="val"/>
|
|
|
+ <xsl:value-of select="$var"/><xsl:text>=</xsl:text><xsl:value-of select="$val"/><xsl:text>
</xsl:text>
|
|
|
+ </xsl:template>
|
|
|
+ <!-- printVar -->
|
|
|
+
|
|
|
<!--getDaliServers-->
|
|
|
<xsl:template name="getDaliServers">
|
|
|
<xsl:param name="daliServer"/>
|