Merge pull request #86 from opennetworkinglab/remove-intent_newOptions
Modified removeIntent() to add new puge and sync options
diff --git a/TestON/drivers/common/cli/onosclidriver.py b/TestON/drivers/common/cli/onosclidriver.py
index bfed3eb..d312f16 100644
--- a/TestON/drivers/common/cli/onosclidriver.py
+++ b/TestON/drivers/common/cli/onosclidriver.py
@@ -1254,16 +1254,26 @@
main.cleanup()
main.exit()
- def removeIntent( self, intentId ):
+ def removeIntent( self, intentId, app = 'org.onosproject.cli',
+ purge = False, sync = False ):
"""
- Remove intent for specified intent id
-
+ Remove intent for specified application id and intent id
+ Optional args:-
+ -s or --sync: Waits for the removal before returning
+ -p or --purge: Purge the intent from the store after removal
+
Returns:
main.False on error and
cli output otherwise
"""
try:
- cmdStr = "remove-intent org.onosproject.cli " + str( intentId )
+ cmdStr = "remove-intent "
+ if purge:
+ cmdStr += " -p"
+ if sync:
+ cmdStr += " -s"
+
+ cmdStr += " " + app + " " + str( intentId )
handle = self.sendline( cmdStr )
if re.search( "Error", handle ):
main.log.error( "Error in removing intent" )