xcat2 / xcat-inventory

An inventory tool for xcat cluster
8 stars 16 forks source link

"xcat-inventory import -c -t site -f xxx" should clear the site table first #139

Closed immarvin closed 5 years ago

immarvin commented 5 years ago

currently, xcat-inventory import -c is to clean the inventory object first, then import the object. site table is a special case, we should follow the similar rule for site with node/osimage....

immarvin commented 5 years ago

fixed in https://github.com/xcat2/xcat-inventory/pull/142

UT:

[root@c910f03c05k21 inventory]# tabdump site
#key,value,comments,disable
"auditnosyslog","0",,
"auditskipcmds","ALL",,
"blademaxp","64",,
"cleanupxcatpost","no",,
"consoleondemand","no",,
"databaseloc","/var/lib",,
"db2installloc","/mntdb2",,
"dhcplease","43200",,
"dnshandler","ddns",,
"domain","clusters.com",,
"enableASMI","no",,
"forwarders","10.0.0.101",,
"fsptimeout","0",,
"installdir","/install",,
"ipmimaxp","64",,
"ipmiretries","3",,
"ipmitimeout","2",,
"master","10.3.5.21",,
"maxssh","8",,
"nameservers","10.3.5.21",,
"nodesyncfiledir","/var/xcat/node/syncfiles",,
"powerinterval","0",,
"ppcmaxp","64",,
"ppcretry","3",,
"ppctimeout","0",,
"sharedtftp","1",,
"SNsyncfiledir","/var/xcat/syncfiles",,
"sshbetweennodes","ALLGROUPS",,
"syspowerinterval","0",,
"tftpdir","/tftpboot",,
"timezone","America/New_York",,
"useNmapfromMN","no",,
"vsftp","n",,
"xcatconfdir","/etc/xcat",,
"xcatdebugmode","1",,
"xcatdport","3001",,
"xcatiport","3002",,
"xcatsslversion","TLSv1",,

[root@c910f03c05k21 inventory]# cat /tmp/site
schema_version: '2.0'
site:
  clustersite:
    SNsyncfiledir: /var/xcat/syncfiles
    auditnosyslog: '0'
    auditskipcmds: ALL
    blademaxp: '64'
    cleanupxcatpost: 'no'
    consoleondemand: 'no'
    databaseloc: /var/lib
    db2installloc: /mntdb2
    dhcplease: '43200'
    dnshandler: ddns
    domain: clusters.com
    enableASMI: 'no'
    forwarders: 10.0.0.101
    fsptimeout: '0'
    installdir: /install
    ipmimaxp: '64'
    ipmiretries: '3'
    ipmitimeout: '2'
    master: 10.3.5.21
    maxssh: '8'
    nameservers: 10.3.5.21
    nodesyncfiledir: /var/xcat/node/syncfiles
    powerinterval: '0'
    ppcmaxp: '64'
    ppcretry: '3'
    ppctimeout: '0'
    sharedtftp: '1'
    sshbetweennodes: ALLGROUPS
    syspowerinterval: '0'
    tftpdir: /tftpboot
    timezone: America/New_York
    useNmapfromMN: 'no'
    vsftp: n
    xcatconfdir: /etc/xcat
    xcatdport: '3001'
    xcatiport: '3002'
    xcatsslversion: TLSv1

#Version 2.14.5 (git commit 5bab3f8bac3374cd9cb2e26b4a71c7cb32bb1126, built Mon Oct 22 06:16:06 EDT 2018)

[root@c910f03c05k21 inventory]# xcat-inventory import -f /tmp/site -c
loading inventory date in "/tmp/site"
start to import "site" type objects
 preprocessing "site" type objects
 writting "site" type objects
Inventory import successfully!
[root@c910f03c05k21 inventory]# tabdump site
#key,value,comments,disable
"auditnosyslog","0",,
"auditskipcmds","ALL",,
"blademaxp","64",,
"cleanupxcatpost","no",,
"consoleondemand","no",,
"databaseloc","/var/lib",,
"db2installloc","/mntdb2",,
"dhcplease","43200",,
"dnshandler","ddns",,
"domain","clusters.com",,
"enableASMI","no",,
"forwarders","10.0.0.101",,
"fsptimeout","0",,
"installdir","/install",,
"ipmimaxp","64",,
"ipmiretries","3",,
"ipmitimeout","2",,
"master","10.3.5.21",,
"maxssh","8",,
"nameservers","10.3.5.21",,
"nodesyncfiledir","/var/xcat/node/syncfiles",,
"powerinterval","0",,
"ppcmaxp","64",,
"ppcretry","3",,
"ppctimeout","0",,
"sharedtftp","1",,
"SNsyncfiledir","/var/xcat/syncfiles",,
"sshbetweennodes","ALLGROUPS",,
"syspowerinterval","0",,
"tftpdir","/tftpboot",,
"timezone","America/New_York",,
"useNmapfromMN","no",,
"vsftp","n",,
"xcatconfdir","/etc/xcat",,
"xcatdport","3001",,
"xcatiport","3002",,
"xcatsslversion","TLSv1",,