-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enhancement on DB operations in import #142
Conversation
… file still left afer import
@@ -0,0 +1,280 @@ | |||
!!python/dict |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
xcat-inventory/xcclient/inventory/schema/2.0/1
is not valid schema file name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@@ -244,23 +331,27 @@ def cleartab(self,tabs): | |||
flattabs.append(tab) | |||
else: | |||
matrixtabs.append(tab) | |||
for tab in matrixtabs: | |||
for tab in tabs: | |||
if hasattr(dbobject,tab): | |||
tabcls=getattr(dbobject,tab) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line 323~333: to generate flattabs and matrixtabs. But these 2 lists are not used by function cleartab
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
|
||
if tabkey != item and newdict[item] is None: | ||
if item not in objkeys and newdict[item] is None: | ||
newdict[item]='' | ||
|
||
#delete table rows when (1)the key is None or blank (2)the key is not specified in newdict and all non-key values are blank |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you update the comments according to new codes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
#print(tabdict) | ||
#print("\n") | ||
if tabdict is None: | ||
return None | ||
for key in tabdict.keys(): | ||
utils.verbose(" writting object: "+str(key),file=sys.stdout) | ||
#clear any existing table entries before adding new entries | ||
df=dbfactory(self._dbsession) | ||
df.cleartab(tabdict[key].keys(),[key]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When it is not update, manager.py
calls cleartab
to clear up db, there is no data in DB now. In line 171 call cleartab, it clear up DB again in for loop. And if there are too many nodes, for each node, it clear up switch
table once, the performance can be enhanced here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will refine this in following sprints
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I opened a ticket to trace this enhance #147, thanks
I agree to merge this pull request for functions fixing , the DB execution performance enhancement ticket (#147) can be planned in another sprint. Thanks |
Description:
xcat-inventory
#140 and xcat-inventory import support multiple keys object passwd #138, theimport -c
support for site object issue "xcat-inventory import -c -t site -f xxx" should clear the site table first #139REF{<sub inventory object>}
syntax2.0
, a sub inventory typenetworkconn
is added to describe the network connection info inswitch
tableUT:
network_info. connections
of node object , export node object:passwd
:passwd
: