cisco-system-traffic-generator/trex-core

ASTF acquire command is clearing just loaded profiles and topology

jsmoon opened this issue · 3 comments

Hi, recently I found that the following code in ASTF "acquire" command clears just loaded profiles and topology.

stringstream ss;
vector<string> profile_list = stx->get_profile_id_list();
for ( auto profile_id : profile_list ) {
try {
TrexAstfPerProfile *pid = stx->get_profile(profile_id);
if ( pid->profile_needs_parsing() ) {
pid->profile_init();
}
} catch (const TrexException &ex) {
res["exception"][profile_id] = ex.what();
}
}
if ( stx->topo_needs_parsing() ) {
stx->topo_clear();
}

I did not expect this behavior before, because I thought the "acquire" would get server ownership only.
Is there any reason to do this?
I think the loaded profiles and topology should be kept also like the already parsed profiles and topology.
@hhaim, what do you think about it?

hhaim commented

@jsmoon if the state was changed from "not_acquire" > "acquire" you can't keep the old user profiles and data.

@hhaim but already parsed profiles are kept.
And I think cleaning up old user profiles and data can be done separately after acquisition.

@hhaim please review my comment again.
There is an inconsistency between the run profile (keep) and the loaded profile (clear).