Skip to content

Commit

Permalink
Fix #1690 Fix Computer node name when using wizard to generate the en…
Browse files Browse the repository at this point in the history
…vironment

When using wizard, Computer nodes use the same naming scheme as advanced mode.

Signed-off-by: Sridhar Meda <sridhar.meda@lexisnexis.com>
  • Loading branch information
smeda committed Mar 8, 2012
1 parent b3ca9c5 commit d29db88
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions deployment/deployutils/wizardInputs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -471,20 +471,29 @@ IPropertyTree* CWizardInputs::createEnvironment()
xpath.clear().append(XML_TAG_COMPUTERTYPE).append("/").append(XML_ATTR_OPSYS);
pCompTree->setProp(xpath.str(), "linux");

unsigned x;
IpAddress ipaddr;

for(unsigned i = 0; i < m_ipaddressSupport.ordinality(); i++)
{
IPropertyTree* pComputer = pCompTree->addPropTree(XML_TAG_COMPUTER,createPTree());
name.clear().appendf("node%03d", (i + 1));
ipaddr.ipset(m_ipaddressSupport.item(i));
ipaddr.getNetAddress(sizeof(x),&x);
name.clear().appendf("node%03d%03d", (x >> 16) & 0xFF, (x >> 24) & 0xFF);
getUniqueName(pCompTree, name, XML_TAG_COMPUTER, "");
pComputer->addProp(XML_ATTR_COMPUTERTYPE, "linuxmachine");
pComputer->addProp(XML_ATTR_DOMAIN, "localdomain");
pComputer->addProp(XML_ATTR_NAME, name.str());
pComputer->addProp(XML_ATTR_NETADDRESS, m_ipaddressSupport.item(i));
}

for(unsigned i = 0; i < m_ipaddress.ordinality(); i++)
{
{
IPropertyTree* pComputer = pCompTree->addPropTree(XML_TAG_COMPUTER,createPTree());
name.clear().appendf("node%03d", (m_ipaddressSupport.ordinality() + i + 1));
ipaddr.ipset(m_ipaddress.item(i));
ipaddr.getNetAddress(sizeof(x),&x);
name.clear().appendf("node%03d%03d", (x >> 16) & 0xFF, (x >> 24) & 0xFF);
getUniqueName(pCompTree, name, XML_TAG_COMPUTER, "");
pComputer->addProp(XML_ATTR_COMPUTERTYPE, "linuxmachine");
pComputer->addProp(XML_ATTR_DOMAIN, "localdomain");
pComputer->addProp(XML_ATTR_NAME, name.str());
Expand Down

0 comments on commit d29db88

Please sign in to comment.