Преглед изворни кода

Merge pull request #9993 from Michael-Gardner/HPCC-17629

HPCC-17629 Automatically assign DropZone to support node when using wizard

Reviewed-By: Greg Panagiotatos <Greg.Panagiotatos@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman пре 8 година
родитељ
комит
6a4d5ebc79

+ 20 - 0
deployment/deployutils/deployutils.cpp

@@ -1670,6 +1670,26 @@ public:
             }
           }
         }
+        else if(!strcmp(type,"serverListType"))
+        {
+          if(m_wizard)
+          {
+            StringBuffer buildSetName, ipAddr;
+            tempPath.clear().appendf("./Programs/Build/BuildSet[%s=\"%s\"]",XML_ATTR_PROCESS_NAME,m_compName.str());
+            IPropertyTree* pCompTree = m_pEnv->queryPropTree(tempPath.str());
+            if(pCompTree)
+            {
+              buildSetName.append(pCompTree->queryProp(XML_ATTR_NAME));
+              CInstDetails* pInst  = m_wizard->getServerIPMap(compName, buildSetName,m_pEnv);
+              if( pInst )
+              {
+                StringArray& ipArray = pInst->getIpAssigned();
+                if(ipArray.length())
+                  wizDefVal.clear().append(ipArray.item(0));
+              }
+            }
+          }
+        }
         else if(!strcmp(type,"xs:string"))
         {
           StringBuffer nameOfComp;

+ 2 - 1
initfiles/componentfiles/configxml/dropzone.xsd.in

@@ -105,12 +105,13 @@
                             <xs:element name="ServerListEntry" type="xs:string" minOccurs="0" maxOccurs="1"/>
                         </xs:sequence>
                     </xs:complexType>
-                    <xs:attribute name="server" type="string" use="required">
+                    <xs:attribute name="server" type="serverListType" use="required">
                         <xs:annotation>
                             <xs:appinfo>
                                 <title>Server Address</title>
                                 <tooltip>Server Address to associate with this DropZone</tooltip>
                                 <width>120</width>
+                                <autogenforwizard>1</autogenforwizard>
                             </xs:appinfo>
                         </xs:annotation>
                     </xs:attribute>