Changeset 1854
- Timestamp:
- 01/16/12 06:27:15 (4 months ago)
- Location:
- trunk
- Files:
-
- 2 modified
-
tcontainer.c (modified) (1 diff)
-
tcontainerfunc.h (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tcontainer.c
r1723 r1854 495 495 { 496 496 char cAutoCloneSyncTime[256]={""}; 497 char cAutoCloneNode[256]={""}; 498 unsigned uTargetDatacenter=0; 499 500 MYSQL_RES *res; 501 MYSQL_ROW field; 497 502 498 503 OpenRow("Clone target node","black"); 499 tTablePullDownDatacenter("tNode;cuTargetNodePullDown","cLabel","cLabel",uTargetNode,1, 500 cuTargetNodePullDown,0,uDatacenter);//0 does not use tProperty, uses uDatacenter 504 GetConfiguration("cAutoCloneNode",cAutoCloneNode,uDatacenter,uNode,0,0); 505 sprintf(gcQuery,"SELECT uNode,uDatacenter FROM tNode WHERE cLabel='%s'",cAutoCloneNode); 506 MYSQL_RUN_STORE(res); 507 if((field=mysql_fetch_row(res))) 508 { 509 sscanf(field[0],"%u",&uTargetNode); 510 sscanf(field[1],"%u",&uTargetDatacenter); 511 } 512 tTablePullDown("tNode;cuTargetNodePullDown","cLabel","cLabel",uTargetNode,0); 501 513 502 514 OpenRow("Clone start uIPv4","black"); 503 515 tTablePullDownOwnerAvailDatacenter("tIP;cuWizIPv4PullDown","cLabel","cLabel",uWizIPv4,1, 504 u Datacenter,uForClient);516 uTargetDatacenter,uForClient); 505 517 506 518 OpenRow("Keep clone stopped","black"); -
trunk/tcontainerfunc.h
r1853 r1854 1596 1596 unsigned uHostnameLen=0; 1597 1597 unsigned uLabelLen=0; 1598 unsigned uTargetDatacenter=0; 1598 1599 1599 1600 ProcesstContainerVars(entries,x); … … 1711 1712 "Select another."); 1712 1713 1713 sscanf(ForeignKey("tNode","uDatacenter",uTargetNode),"%u",&uNodeDatacenter); 1714 if(uDatacenter!=uNodeDatacenter) 1715 tContainer("<blink>Error:</blink> The specified clone uNode does not " 1716 "belong to the specified uDatacenter."); 1714 //We are moving to normal remote datacenter clone containers 1715 sscanf(ForeignKey("tNode","uDatacenter",uTargetNode),"%u",&uTargetDatacenter); 1716 //if(uDatacenter!=uTargetDatacenter) 1717 // tContainer("<blink>Error:</blink> The specified clone uNode does not " 1718 // "belong to the specified uDatacenter."); 1717 1719 if(!uWizIPv4) 1718 1720 tContainer("<blink>Error:</blink> You must select an IP for the clone"); … … 1721 1723 " clone"); 1722 1724 sscanf(ForeignKey("tIP","uDatacenter",uWizIPv4),"%u",&uIPv4Datacenter); 1723 if(u Datacenter!=uIPv4Datacenter)1724 tContainer("<blink>Error:</blink> The specified uIPv4 does not "1725 "belong to the specified u Datacenter.");1725 if(uTargetDatacenter!=uIPv4Datacenter) 1726 tContainer("<blink>Error:</blink> The specified clone uIPv4 does not " 1727 "belong to the specified uTargetDatacenter."); 1726 1728 if(cNCCloneRange[0] && !uIpv4InCIDR4(ForeignKey("tIP","cLabel",uWizIPv4),cNCCloneRange)) 1727 1729 tContainer("<blink>Error:</blink> Clone start uIPv4 must be in datacenter clone IP range"); … … 1788 1790 { 1789 1791 sprintf(gcQuery,"SELECT cLabel FROM tIP WHERE uIP=%u AND uAvailable=1" 1790 " AND uOwner=%u AND uDatacenter=%u",uWizIPv4,uForClient,u Datacenter);1792 " AND uOwner=%u AND uDatacenter=%u",uWizIPv4,uForClient,uTargetDatacenter); 1791 1793 mysql_query(&gMysql,gcQuery); 1792 1794 if(mysql_errno(&gMysql)) … … 1819 1821 sprintf(gcQuery,"SELECT COUNT(uIP) FROM tIP WHERE uAvailable=1 AND uOwner=%u" 1820 1822 " AND cLabel LIKE '%s%%' AND uDatacenter=%u", 1821 uForClient,cIPv4ClassCClone,u Datacenter);1823 uForClient,cIPv4ClassCClone,uTargetDatacenter); 1822 1824 mysql_query(&gMysql,gcQuery); 1823 1825 if(mysql_errno(&gMysql)) … … 2002 2004 uSearchdomain, 2003 2005 uDatacenter, 2004 u Datacenter,2006 uTargetDatacenter, 2005 2007 uForClient, 2006 2008 cLabel, … … 2024 2026 sprintf(gcQuery,"SELECT uIP FROM tIP WHERE uAvailable=1 AND uOwner=%u" 2025 2027 " AND cLabel LIKE '%s%%' AND uDatacenter=%u LIMIT 1", 2026 uForClient,cIPv4ClassCClone,u Datacenter);2028 uForClient,cIPv4ClassCClone,uTargetDatacenter); 2027 2029 mysql_query(&gMysql,gcQuery); 2028 2030 if(mysql_errno(&gMysql))
