diff --git a/TestON/drivers/common/cli/onosclidriver.py b/TestON/drivers/common/cli/onosclidriver.py
index aec6122..b8a2bd5 100644
--- a/TestON/drivers/common/cli/onosclidriver.py
+++ b/TestON/drivers/common/cli/onosclidriver.py
@@ -20,7 +20,7 @@
 import pexpect
 import re
 import traceback
-# import os.path
+#import os.path
 sys.path.append( "../" )
 from drivers.common.clidriver import CLI
 
@@ -49,10 +49,10 @@
             self.name = self.options[ 'name' ]
             self.handle = super( OnosCliDriver, self ).connect(
                 user_name=self.user_name,
-                    ip_address=self.ip_address,
-                    port=self.port,
-                    pwd=self.pwd,
-                    home=self.home )
+                ip_address=self.ip_address,
+                port=self.port,
+                pwd=self.pwd,
+                home=self.home )
 
             self.handle.sendline( "cd " + self.home )
             self.handle.expect( "\$" )
@@ -193,7 +193,7 @@
             self.handle.sendline( "onos -w " + str( ONOS_ip ) )
             i = self.handle.expect( [
                 "onos>",
-                    pexpect.TIMEOUT ], timeout=60 )
+                pexpect.TIMEOUT ], timeout=60 )
 
             if i == 0:
                 main.log.info( str( ONOS_ip ) + " CLI Started successfully" )
@@ -240,13 +240,8 @@
             main.cleanup()
             main.exit()
 
-<<<<<<< HEAD
-    def sendline(self, cmd_str):
-        '''
-=======
     def sendline( self, cmd_str ):
         """
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
         Send a completely user specified string to
         the onos> prompt. Use this function if you have
         a very specific command to send.
@@ -258,28 +253,11 @@
             self.handle.sendline( "" )
             self.handle.expect( "onos>" )
 
-<<<<<<< HEAD
-            self.handle.sendline("log:log \"Sending CLI command: '"
-                    + cmd_str + "'\"")
-            self.handle.expect("onos>")
+            self.handle.sendline( "log:log \"Sending CLI command: '"
+                                  + cmd_str + "'\"" )
+            self.handle.expect( "onos>" )
             self.handle.sendline( cmd_str )
             self.handle.expect( cmd_str )
-            self.handle.expect("onos>")
-
-            handle = self.handle.before
-
-            self.handle.sendline("")
-            self.handle.expect("onos>")
-
-            #handle += self.handle.before
-            #handle += self.handle.after
-
-            main.log.info("Command '" + str( cmd_str ) + "' sent to "
-                    + self.name + ".")
-            ansi_escape = re.compile(r'\x1b[^m]*m')
-            handle = ansi_escape.sub('', handle)
-=======
-            self.handle.sendline( cmd_str )
             self.handle.expect( "onos>" )
 
             handle = self.handle.before
@@ -287,13 +265,13 @@
             self.handle.sendline( "" )
             self.handle.expect( "onos>" )
 
-            handle += self.handle.before
-            handle += self.handle.after
+            #handle += self.handle.before
+            #handle += self.handle.after
 
-            main.log.info( "Command sent." )
+            main.log.info( "Command '" + str(cmd_str) + "' sent to "
+                           + self.name + "." )
             ansi_escape = re.compile( r'\x1b[^m]*m' )
             handle = ansi_escape.sub( '', handle )
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
 
             return handle
         except pexpect.EOF:
@@ -315,13 +293,8 @@
     #    onos:links    > onos_links
     #    feature:list  > feature_list
 
-<<<<<<< HEAD
-    def add_node(self, node_id, ONOS_ip, tcp_port=""):
-        '''
-=======
     def add_node( self, node_id, ONOS_ip, tcp_port="" ):
         """
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
         Adds a new cluster node by ID and address information.
         Required:
             * node_id
@@ -330,36 +303,12 @@
             * tcp_port
         """
         try:
-<<<<<<< HEAD
-            cmd_str = "add-node " + str(node_id) + " " +\
-                    str(ONOS_ip) + " " + str(tcp_port)
+            cmd_str = "add-node " + str( node_id ) + " " +\
+                str( ONOS_ip ) + " " + str( tcp_port )
             handle = self.sendline( cmd_str )
-            if re.search("Error", handle):
-                main.log.error("Error in adding node")
-                main.log.error(handle)
-=======
-            self.handle.sendline( "" )
-            self.handle.expect( "onos>" )
-
-            self.handle.sendline( "add-node " +
-                                  str( node_id ) + " " +
-                                  str( ONOS_ip ) + " " +
-                                  str( tcp_port ) )
-
-            i = self.handle.expect( [
-                "Error",
-                "onos>" ] )
-
-            # Clear handle to get previous output
-            self.handle.sendline( "" )
-            self.handle.expect( "onos>" )
-
-            handle = self.handle.before
-
-            if i == 0:
+            if re.search( "Error", handle ):
                 main.log.error( "Error in adding node" )
                 main.log.error( handle )
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
                 return main.FALSE
             else:
                 main.log.info( "Node " + str( ONOS_ip ) + " added" )
@@ -384,18 +333,10 @@
             * node_id
         """
         try:
-<<<<<<< HEAD
 
-            cmd_str = "remove-node " + str(node_id)
+            cmd_str = "remove-node " + str( node_id )
             self.sendline( cmd_str )
             # TODO: add error checking. Does ONOS give any errors?
-=======
-            self.handle.sendline( "" )
-            self.handle.expect( "onos>" )
-
-            self.handle.sendline( "remove-node " + str( node_id ) )
-            self.handle.expect( "onos>" )
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
 
             return main.TRUE
 
@@ -418,22 +359,8 @@
         Returns: entire handle of list of nodes
         """
         try:
-<<<<<<< HEAD
             cmd_str = "nodes"
             handle = self.sendline( cmd_str )
-=======
-            self.handle.sendline( "" )
-            self.handle.expect( "onos>" )
-
-            self.handle.sendline( "nodes" )
-            self.handle.expect( "onos>" )
-
-            self.handle.sendline( "" )
-            self.handle.expect( "onos>" )
-
-            handle = self.handle.before
-
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
             return handle
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
@@ -453,27 +380,11 @@
         by issusing command: 'onos> onos:topology'
         """
         try:
-<<<<<<< HEAD
             # either onos:topology or 'topology' will work in CLI
             cmd_str = "onos:topology"
             handle = self.sendline( cmd_str )
             main.log.info( "onos:topology returned: " + str( handle ) )
             return handle
-=======
-            self.handle.sendline( "" )
-            self.handle.expect( "onos>" )
-            # either onos:topology or 'topology' will work in CLI
-            self.handle.sendline( "onos:topology" )
-            self.handle.expect( "onos>" )
-
-            handle = self.handle.before
-
-            main.log.info( "onos:topology returned: " +
-                           str( handle ) )
-
-            return handle
-
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
@@ -486,29 +397,15 @@
             main.cleanup()
             main.exit()
 
-<<<<<<< HEAD
-    def feature_install(self, feature_str):
-        '''
-=======
     def feature_install( self, feature_str ):
         """
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
         Installs a specified feature
         by issuing command: 'onos> feature:install <feature_str>'
         """
         try:
-<<<<<<< HEAD
             cmd_str = "feature:install " + str( feature_str )
             self.sendline( cmd_str )
             # TODO: Check for possible error responses from karaf
-=======
-            self.handle.sendline( "" )
-            self.handle.expect( "onos>" )
-
-            self.handle.sendline( "feature:install " + str( feature_str ) )
-            self.handle.expect( "onos>" )
-
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
             return main.TRUE
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
@@ -526,29 +423,15 @@
             main.cleanup()
             main.exit()
 
-<<<<<<< HEAD
-    def feature_uninstall(self, feature_str):
-        '''
-=======
     def feature_uninstall( self, feature_str ):
         """
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
         Uninstalls a specified feature
         by issuing command: 'onos> feature:uninstall <feature_str>'
         """
         try:
-<<<<<<< HEAD
             cmd_str = "feature:uninstall " + str( feature_str )
             self.sendline( cmd_str )
             # TODO: Check for possible error responses from karaf
-=======
-            self.handle.sendline( "" )
-            self.handle.expect( "onos>" )
-
-            self.handle.sendline( "feature:uninstall " + str( feature_str ) )
-            self.handle.expect( "onos>" )
-
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
             return main.TRUE
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
@@ -569,57 +452,28 @@
             * json_format - boolean indicating if you want output in json
         """
         try:
-<<<<<<< HEAD
             if json_format:
                 cmd_str = "devices -j"
                 handle = self.sendline( cmd_str )
-                '''
+                """
                 handle variable here contains some ANSI escape color code
                 sequences at the end which are invisible in the print command
                 output. To make that escape sequence visible, use repr()
-                function. The repr(handle) output when printed shows the
-                ANSI escape sequences. In json.loads(somestring), this
-                somestring variable is actually repr(somestring) and
+                function. The repr( handle ) output when printed shows the
+                ANSI escape sequences. In json.loads( somestring ), this
+                somestring variable is actually repr( somestring ) and
                 json.loads would fail with the escape sequence. So we take off
                 that escape sequence using:
 
-                ansi_escape = re.compile(r'\r\r\n\x1b[^m]*m')
-                handle1 = ansi_escape.sub('', handle)
-                '''
-                ansi_escape = re.compile(r'\r\r\n\x1b[^m]*m')
-                handle1 = ansi_escape.sub('', handle)
+                ansi_escape = re.compile( r'\r\r\n\x1b[^m]*m' )
+                handle1 = ansi_escape.sub( '', handle )
+                """
+                ansi_escape = re.compile( r'\r\r\n\x1b[^m]*m' )
+                handle1 = ansi_escape.sub( '', handle )
                 return handle1
             else:
                 cmd_str = "devices"
                 handle = self.sendline( cmd_str )
-=======
-            self.handle.sendline( "" )
-            self.handle.expect( "onos>" )
-
-            if json_format:
-                self.handle.sendline( "devices -j" )
-                self.handle.expect( "devices -j" )
-                self.handle.expect( "onos>" )
-                handle = self.handle.before
-                """
-                handle variable here contains some ANSI escape color code sequences at the end which are invisible in the print command output
-                To make that escape sequence visible, use repr() function. The repr( handle ) output when printed shows the ANSI escape sequences.
-                In json.loads( somestring ), this somestring variable is actually repr( somestring ) and json.loads would fail with the escape sequence.
-                So we take off that escape sequence using
-                ansi_escape = re.compile( r'\r\r\n\x1b[^m]*m' )
-                handle1 = ansi_escape.sub( '', handle )
-                """
-                # print "repr(handle) =", repr( handle )
-                ansi_escape = re.compile( r'\r\r\n\x1b[^m]*m' )
-                handle1 = ansi_escape.sub( '', handle )
-                # print "repr(handle1) = ", repr( handle1 )
-                return handle1
-            else:
-                self.handle.sendline( "devices" )
-                self.handle.expect( "onos>" )
-                handle = self.handle.before
-                # print "handle =",handle
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
                 return handle
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
@@ -633,29 +487,16 @@
             main.cleanup()
             main.exit()
 
-<<<<<<< HEAD
-    def balance_masters(self):
-        '''
-=======
     def balance_masters( self ):
         """
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
         This balances the devices across all controllers
         by issuing command: 'onos> onos:balance-masters'
         If required this could be extended to return devices balanced output.
         """
         try:
-<<<<<<< HEAD
             cmd_str = "onos:balance-masters"
             self.sendline( cmd_str )
             # TODO: Check for error responses from ONOS
-=======
-            self.handle.sendline( "" )
-            self.handle.expect( "onos>" )
-
-            self.handle.sendline( "onos:balance-masters" )
-            self.handle.expect( "onos>" )
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
             return main.TRUE
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
@@ -676,57 +517,28 @@
             * json_format - boolean indicating if you want output in json
         """
         try:
-<<<<<<< HEAD
             if json_format:
                 cmd_str = "links -j"
                 handle = self.sendline( cmd_str )
-                '''
+                """
                 handle variable here contains some ANSI escape color code
                 sequences at the end which are invisible in the print command
                 output. To make that escape sequence visible, use repr()
-                function. The repr(handle) output when printed shows the ANSI
-                escape sequences. In json.loads(somestring), this somestring
-                variable is actually repr(somestring) and json.loads would
+                function. The repr( handle ) output when printed shows the ANSI
+                escape sequences. In json.loads( somestring ), this somestring
+                variable is actually repr( somestring ) and json.loads would
                 fail with the escape sequence. So we take off that escape
                 sequence using:
 
-                ansi_escape = re.compile(r'\r\r\n\x1b[^m]*m')
-                handle1 = ansi_escape.sub('', handle)
-                '''
-                ansi_escape = re.compile(r'\r\r\n\x1b[^m]*m')
-                handle1 = ansi_escape.sub('', handle)
+                ansi_escape = re.compile( r'\r\r\n\x1b[^m]*m' )
+                handle1 = ansi_escape.sub( '', handle )
+                """
+                ansi_escape = re.compile( r'\r\r\n\x1b[^m]*m' )
+                handle1 = ansi_escape.sub( '', handle )
                 return handle1
             else:
                 cmd_str = "links"
                 handle = self.sendline( cmd_str )
-=======
-            self.handle.sendline( "" )
-            self.handle.expect( "onos>" )
-
-            if json_format:
-                self.handle.sendline( "links -j" )
-                self.handle.expect( "links -j" )
-                self.handle.expect( "onos>" )
-                handle = self.handle.before
-                """
-                handle variable here contains some ANSI escape color code sequences at the end which are invisible in the print command output
-                To make that escape sequence visible, use repr() function. The repr( handle ) output when printed shows the ANSI escape sequences.
-                In json.loads( somestring ), this somestring variable is actually repr( somestring ) and json.loads would fail with the escape sequence.
-                So we take off that escape sequence using
-                ansi_escape = re.compile( r'\r\r\n\x1b[^m]*m' )
-                handle1 = ansi_escape.sub( '', handle )
-                """
-                # print "repr(handle) =", repr( handle )
-                ansi_escape = re.compile( r'\r\r\n\x1b[^m]*m' )
-                handle1 = ansi_escape.sub( '', handle )
-                # print "repr(handle1) = ", repr( handle1 )
-                return handle1
-            else:
-                self.handle.sendline( "links" )
-                self.handle.expect( "onos>" )
-                handle = self.handle.before
-                # print "handle =",handle
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
                 return handle
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
@@ -740,73 +552,36 @@
             main.cleanup()
             main.exit()
 
-<<<<<<< HEAD
-    def ports(self, json_format=True):
-        '''
-=======
     def ports( self, json_format=True ):
         """
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
         Lists all ports
         Optional argument:
             * json_format - boolean indicating if you want output in json
         """
         try:
-<<<<<<< HEAD
             if json_format:
                 cmd_str = "ports -j"
                 handle = self.sendline( cmd_str )
-                '''
+                """
                 handle variable here contains some ANSI escape color code
                 sequences at the end which are invisible in the print command
                 output. To make that escape sequence visible, use repr()
-                function. The repr(handle) output when printed shows the ANSI
-                escape sequences. In json.loads(somestring), this somestring
-                variable is actually repr(somestring) and json.loads would
+                function. The repr( handle ) output when printed shows the ANSI
+                escape sequences. In json.loads( somestring ), this somestring
+                variable is actually repr( somestring ) and json.loads would
                 fail with the escape sequence. So we take off that escape
                 sequence using the following commads:
 
-                ansi_escape = re.compile(r'\r\r\n\x1b[^m]*m')
-                handle1 = ansi_escape.sub('', handle)
-                '''
-                ansi_escape = re.compile(r'\r\r\n\x1b[^m]*m')
-                handle1 = ansi_escape.sub('', handle)
+                ansi_escape = re.compile( r'\r\r\n\x1b[^m]*m' )
+                handle1 = ansi_escape.sub( '', handle )
+                """
+                ansi_escape = re.compile( r'\r\r\n\x1b[^m]*m' )
+                handle1 = ansi_escape.sub( '', handle )
                 return handle1
 
             else:
                 cmd_str = "ports"
                 handle = self.sendline( cmd_str )
-=======
-            self.handle.sendline( "" )
-            self.handle.expect( "onos>" )
-
-            if json_format:
-                self.handle.sendline( "ports -j" )
-                self.handle.expect( "ports -j" )
-                self.handle.expect( "onos>" )
-                handle = self.handle.before
-                """
-                handle variable here contains some ANSI escape color code sequences at the end which are invisible in the print command output
-                To make that escape sequence visible, use repr() function. The repr( handle ) output when printed shows the ANSI escape sequences.
-                In json.loads( somestring ), this somestring variable is actually repr( somestring ) and json.loads would fail with the escape sequence.
-                So we take off that escape sequence using the following commads:
-                ansi_escape = re.compile( r'\r\r\n\x1b[^m]*m' )
-                handle1 = ansi_escape.sub( '', handle )
-                """
-                # print "repr(handle) =", repr( handle )
-                ansi_escape = re.compile( r'\r\r\n\x1b[^m]*m' )
-                handle1 = ansi_escape.sub( '', handle )
-                # print "repr(handle1) = ", repr( handle1 )
-                return handle1
-
-            else:
-                self.handle.sendline( "ports" )
-                self.handle.expect( "onos>" )
-                self.handle.sendline( "" )
-                self.handle.expect( "onos>" )
-                handle = self.handle.before
-                # print "handle =",handle
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
                 return handle
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
@@ -827,67 +602,31 @@
             * json_format - boolean indicating if you want output in json
         """
         try:
-<<<<<<< HEAD
             if json_format:
                 cmd_str = "roles -j"
                 handle = self.sendline( cmd_str )
-                '''
+                """
                 handle variable here contains some ANSI escape color code
                 sequences at the end which are invisible in the print command
                 output. To make that escape sequence visible, use repr()
-                function. The repr(handle) output when printed shows the ANSI
-                escape sequences. In json.loads(somestring), this somestring
-                variable is actually repr(somestring) and json.loads would
+                function. The repr( handle ) output when printed shows the ANSI
+                escape sequences. In json.loads( somestring ), this somestring
+                variable is actually repr( somestring ) and json.loads would
                 fail with the escape sequence.
 
                 So we take off that escape sequence using the following
                 commads:
 
-                ansi_escape = re.compile(r'\r\r\n\x1b[^m]*m')
-                handle1 = ansi_escape.sub('', handle)
-                '''
-                ansi_escape = re.compile(r'\r\r\n\x1b[^m]*m')
-                handle1 = ansi_escape.sub('', handle)
+                ansi_escape = re.compile( r'\r\r\n\x1b[^m]*m' )
+                handle1 = ansi_escape.sub( '', handle )
+                """
+                ansi_escape = re.compile( r'\r\r\n\x1b[^m]*m' )
+                handle1 = ansi_escape.sub( '', handle )
                 return handle1
 
             else:
                 cmd_str = "roles"
                 handle = self.sendline( cmd_str )
-=======
-            self.handle.sendline( "" )
-            self.handle.expect( "onos>" )
-
-            if json_format:
-                self.handle.sendline( "roles -j" )
-                self.handle.expect( "roles -j" )
-                self.handle.expect( "onos>" )
-                handle = self.handle.before
-                """
-                handle variable here contains some ANSI escape color code sequences at the
-                end which are invisible in the print command output. To make that escape
-                sequence visible, use repr() function. The repr( handle ) output when printed
-                shows the ANSI escape sequences. In json.loads( somestring ), this somestring
-                variable is actually repr( somestring ) and json.loads would fail with the escape
-                sequence.
-
-                So we take off that escape sequence using the following commads:
-                ansi_escape = re.compile( r'\r\r\n\x1b[^m]*m' )
-                handle1 = ansi_escape.sub( '', handle )
-                """
-                # print "repr(handle) =", repr( handle )
-                ansi_escape = re.compile( r'\r\r\n\x1b[^m]*m' )
-                handle1 = ansi_escape.sub( '', handle )
-                # print "repr(handle1) = ", repr( handle1 )
-                return handle1
-
-            else:
-                self.handle.sendline( "roles" )
-                self.handle.expect( "onos>" )
-                self.handle.sendline( "" )
-                self.handle.expect( "onos>" )
-                handle = self.handle.before
-                # print "handle =",handle
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
                 return handle
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
@@ -901,9 +640,8 @@
             main.cleanup()
             main.exit()
 
-<<<<<<< HEAD
-    def get_role(self, device_id):
-        '''
+    def get_role( self, device_id ):
+        """
         Given the a string containing the json representation of the "roles"
         cli command and a partial or whole device id, returns a json object
         containing the roles output for the first device whose id contains
@@ -912,19 +650,7 @@
         Returns:
         A dict of the role assignments for the given device or
         None if no match
-        '''
-=======
-    def get_role( self, device_id ):
         """
-        Given the a string containing the json representation of the "roles" cli command and a
-        partial or whole device id, returns a json object containing the
-        roles output for the first device whose id contains "device_id"
-
-        Returns:
-        Dict of the role assignments for the given device or
-        None if not match
-        """
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
         try:
             import json
             if device_id is None:
@@ -987,40 +713,15 @@
         Issues command: onos:paths <src> <dst>
         """
         try:
-<<<<<<< HEAD
-            cmd_str = "onos:paths " + str(src_id) + " " + str(dst_id)
+            cmd_str = "onos:paths " + str( src_id ) + " " + str( dst_id )
             handle = self.sendline( cmd_str )
             if re.search( "Error", handle ):
-                main.log.error("Error in getting paths")
-                return (handle, "Error")
-            else:
-                path = handle.split(";")[0]
-                cost = handle.split(";")[1]
-                return (path, cost)
-=======
-            self.handle.sendline( "" )
-            self.handle.expect( "onos>" )
-
-            self.handle.sendline( "onos:paths " +
-                                  str( src_id ) + " " + str( dst_id ) )
-            i = self.handle.expect( [
-                "Error",
-                "onos>" ] )
-
-            self.handle.sendline( "" )
-            self.handle.expect( "onos>" )
-
-            handle = self.handle.before
-
-            if i == 0:
                 main.log.error( "Error in getting paths" )
                 return ( handle, "Error" )
             else:
                 path = handle.split( ";" )[ 0 ]
                 cost = handle.split( ";" )[ 1 ]
                 return ( path, cost )
-
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
@@ -1040,57 +741,28 @@
             * json_format - boolean indicating if you want output in json
         """
         try:
-<<<<<<< HEAD
             if json_format:
                 cmd_str = "hosts -j"
                 handle = self.sendline( cmd_str )
-                '''
+                """
                 handle variable here contains some ANSI escape color code
                 sequences at the end which are invisible in the print command
                 output. To make that escape sequence visible, use repr()
-                function. The repr(handle) output when printed shows the ANSI
-                escape sequences. In json.loads(somestring), this somestring
-                variable is actually repr(somestring) and json.loads would
+                function. The repr( handle ) output when printed shows the ANSI
+                escape sequences. In json.loads( somestring ), this somestring
+                variable is actually repr( somestring ) and json.loads would
                 fail with the escape sequence. So we take off that escape
                 sequence using:
 
-                ansi_escape = re.compile(r'\r\r\n\x1b[^m]*m')
-                handle1 = ansi_escape.sub('', handle)
-                '''
-                ansi_escape = re.compile(r'\r\r\n\x1b[^m]*m')
-                handle1 = ansi_escape.sub('', handle)
+                ansi_escape = re.compile( r'\r\r\n\x1b[^m]*m' )
+                handle1 = ansi_escape.sub( '', handle )
+                """
+                ansi_escape = re.compile( r'\r\r\n\x1b[^m]*m' )
+                handle1 = ansi_escape.sub( '', handle )
                 return handle1
             else:
                 cmd_str = "hosts"
                 handle = self.sendline( cmd_str )
-=======
-            self.handle.sendline( "" )
-            self.handle.expect( "onos>" )
-
-            if json_format:
-                self.handle.sendline( "hosts -j" )
-                self.handle.expect( "hosts -j" )
-                self.handle.expect( "onos>" )
-                handle = self.handle.before
-                """
-                handle variable here contains some ANSI escape color code sequences at the end which are invisible in the print command output
-                To make that escape sequence visible, use repr() function. The repr( handle ) output when printed shows the ANSI escape sequences.
-                In json.loads( somestring ), this somestring variable is actually repr( somestring ) and json.loads would fail with the escape sequence.
-                So we take off that escape sequence using
-                ansi_escape = re.compile( r'\r\r\n\x1b[^m]*m' )
-                handle1 = ansi_escape.sub( '', handle )
-                """
-                # print "repr(handle) =", repr( handle )
-                ansi_escape = re.compile( r'\r\r\n\x1b[^m]*m' )
-                handle1 = ansi_escape.sub( '', handle )
-                # print "repr(handle1) = ", repr( handle1 )
-                return handle1
-            else:
-                self.handle.sendline( "hosts" )
-                self.handle.expect( "onos>" )
-                handle = self.handle.before
-                # print "handle =",handle
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
                 return handle
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
@@ -1190,27 +862,11 @@
             specifying the two hosts.
         """
         try:
-<<<<<<< HEAD
-            cmd_str = "add-host-intent " + str(host_id_one) +\
-                    " " + str(host_id_two)
+            cmd_str = "add-host-intent " + str( host_id_one ) +\
+                " " + str( host_id_two )
             handle = self.sendline( cmd_str )
-            main.log.info("Host intent installed between "+
-                    str(host_id_one) + " and " + str(host_id_two))
-=======
-            self.handle.sendline( "" )
-            self.handle.expect( "onos>" )
-
-            self.handle.sendline( "add-host-intent " +
-                                  str( host_id_one ) + " " + str( host_id_two ) )
-            self.handle.expect( "onos>" )
-
-            handle = self.handle.before
-            # print "handle =", handle
-
             main.log.info( "Host intent installed between " +
                            str( host_id_one ) + " and " + str( host_id_two ) )
-
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
             return handle
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
@@ -1231,36 +887,16 @@
             * egress_device: device id of egress device
         Optional:
             TODO: Still needs to be implemented via dev side
-<<<<<<< HEAD
-        '''
+        """
         try:
             cmd_str = "add-optical-intent " + str( ingress_device ) +\
-                    " " + str( egress_device )
+                " " + str( egress_device )
             handle = self.sendline( cmd_str )
-            #If error, return error message
+            # If error, return error message
             if re.search( "Error", handle ):
                 return handle
             else:
                 return main.TRUE
-=======
-        """
-        try:
-            self.handle.sendline( "add-optical-intent " +
-                                  str( ingress_device ) + " " + str( egress_device ) )
-            self.handle.expect( "add-optical-intent" )
-            i = self.handle.expect( [
-                "Error",
-                "onos>" ] )
-
-            handle = self.handle.before
-
-            # If error, return error message
-            if i == 0:
-                return handle
-            else:
-                return main.TRUE
-
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
@@ -1273,19 +909,23 @@
             main.cleanup()
             main.exit()
 
-<<<<<<< HEAD
-    def add_point_intent(self, ingress_device, egress_device,
-            port_ingress="", port_egress="", ethType="", ethSrc="",
-            ethDst="", bandwidth="", lambda_alloc=False,
-            ipProto="", ipSrc="", ipDst="", tcpSrc="", tcpDst=""):
-        '''
-=======
-    def add_point_intent( self, ingress_device, egress_device,
-                          port_ingress="", port_egress="", ethType="", ethSrc="",
-                          ethDst="", bandwidth="", lambda_alloc=False,
-                          ipProto="", ipSrc="", ipDst="", tcpSrc="", tcpDst="" ):
+    def add_point_intent(
+            self,
+            ingress_device,
+            egress_device,
+            port_ingress="",
+            port_egress="",
+            ethType="",
+            ethSrc="",
+            ethDst="",
+            bandwidth="",
+            lambda_alloc=False,
+            ipProto="",
+            ipSrc="",
+            ipDst="",
+            tcpSrc="",
+            tcpDst="" ):
         """
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
         Required:
             * ingress_device: device id of ingress device
             * egress_device: device id of egress device
@@ -1318,10 +958,6 @@
                     and not ipProto and not ipSrc and not ipDst \
                     and not tcpSrc and not tcpDst:
                 cmd = "add-point-intent"
-<<<<<<< HEAD
-
-=======
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
 
             else:
                 cmd = "add-point-intent"
@@ -1329,15 +965,9 @@
                 if ethType:
                     cmd += " --ethType " + str( ethType )
                 if ethSrc:
-<<<<<<< HEAD
-                    cmd += " --ethSrc " + str(ethSrc)
-                if ethDst:
-                    cmd += " --ethDst " + str(ethDst)
-=======
                     cmd += " --ethSrc " + str( ethSrc )
                 if ethDst:
                     cmd += " --ethDst " + str( ethDst )
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
                 if bandwidth:
                     cmd += " --bandwidth " + str( bandwidth )
                 if lambda_alloc:
@@ -1353,13 +983,8 @@
                 if tcpDst:
                     cmd += " --tcpDst " + str( tcpDst )
 
-<<<<<<< HEAD
-            #Check whether the user appended the port
-            #or provided it as an input
-=======
             # Check whether the user appended the port
             # or provided it as an input
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
             if "/" in ingress_device:
                 cmd += " " + str( ingress_device )
             else:
@@ -1369,15 +994,9 @@
                     # TODO: perhaps more meaningful return
                     return main.FALSE
 
-<<<<<<< HEAD
-                cmd += " "+ \
-                    str(ingress_device) + "/" +\
-                    str(port_ingress) + " "
-=======
                 cmd += " " + \
                     str( ingress_device ) + "/" +\
                     str( port_ingress ) + " "
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
 
             if "/" in egress_device:
                 cmd += " " + str( egress_device )
@@ -1387,29 +1006,13 @@
                                     "the egress port" )
                     return main.FALSE
 
-<<<<<<< HEAD
-                cmd += " "+\
-                    str(egress_device) + "/" +\
-                    str(port_egress)
-
-            handle = self.sendline(cmd)
-            if re.search( "Error", handle ):
-                main.log.error("Error in adding point-to-point intent")
-=======
                 cmd += " " +\
                     str( egress_device ) + "/" +\
                     str( port_egress )
 
-            self.handle.sendline( cmd )
-
-            main.log.info( cmd + " sent" )
-            i = self.handle.expect( [
-                "Error",
-                "onos>" ] )
-
-            if i == 0:
+            handle = self.sendline( cmd )
+            if re.search( "Error", handle ):
                 main.log.error( "Error in adding point-to-point intent" )
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
                 return main.FALSE
             else:
                 return main.TRUE
@@ -1425,22 +1028,26 @@
             main.cleanup()
             main.exit()
 
-<<<<<<< HEAD
-
-    def add_multipoint_to_singlepoint_intent(self, ingress_device1,
-            ingress_device2, egress_device, port_ingress="", port_egress="",
-            ethType="", ethSrc="", ethDst="", bandwidth="", lambda_alloc=False, 
-            ipProto="", ipSrc="", ipDst="", tcpSrc="", tcpDst="", setEthSrc="",
-            setEthDst=""):
-        '''
-=======
     def add_multipoint_to_singlepoint_intent(
-                                            self, ingress_device1, ingress_device2, egress_device,
-                                            port_ingress="", port_egress="", ethType="", ethSrc="",
-                                            ethDst="", bandwidth="", lambda_alloc=False,
-                                            ipProto="", ipSrc="", ipDst="", tcpSrc="", tcpDst="", setEthSrc="", setEthDst="" ):
+            self,
+            ingress_device1,
+            ingress_device2,
+            egress_device,
+            port_ingress="",
+            port_egress="",
+            ethType="",
+            ethSrc="",
+            ethDst="",
+            bandwidth="",
+            lambda_alloc=False,
+            ipProto="",
+            ipSrc="",
+            ipDst="",
+            tcpSrc="",
+            tcpDst="",
+            setEthSrc="",
+            setEthDst="" ):
         """
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
         Note:
             This function assumes that there would be 2 ingress devices and
             one egress device. For more number of ingress devices, this
@@ -1488,15 +1095,9 @@
                 if ethType:
                     cmd += " --ethType " + str( ethType )
                 if ethSrc:
-<<<<<<< HEAD
-                    cmd += " --ethSrc " + str(ethSrc)
-                if ethDst:
-                    cmd += " --ethDst " + str(ethDst)
-=======
                     cmd += " --ethSrc " + str( ethSrc )
                 if ethDst:
                     cmd += " --ethDst " + str( ethDst )
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
                 if bandwidth:
                     cmd += " --bandwidth " + str( bandwidth )
                 if lambda_alloc:
@@ -1516,17 +1117,10 @@
                 if setEthDst:
                     cmd += " --setEthDst " + str( setEthDst )
 
-<<<<<<< HEAD
-            #Check whether the user appended the port
-            #or provided it as an input
-            if "/" in ingress_device1:
-                cmd += " "+str(ingress_device1)
-=======
             # Check whether the user appended the port
             # or provided it as an input
             if "/" in ingress_device1:
                 cmd += " " + str( ingress_device1 )
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
             else:
                 if not port_ingress1:
                     main.log.error( "You must specify " +
@@ -1534,15 +1128,9 @@
                     # TODO: perhaps more meaningful return
                     return main.FALSE
 
-<<<<<<< HEAD
-                cmd += " "+ \
-                    str(ingress_device1) + "/" +\
-                    str(port_ingress1) + " "
-=======
                 cmd += " " + \
                     str( ingress_device1 ) + "/" +\
                     str( port_ingress1 ) + " "
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
 
             if "/" in ingress_device2:
                 cmd += " " + str( ingress_device2 )
@@ -1565,29 +1153,13 @@
                                     "the egress port" )
                     return main.FALSE
 
-<<<<<<< HEAD
-                cmd += " "+\
-                    str(egress_device) + "/" +\
-                    str(port_egress)
-            print "cmd= ",cmd
-            handle = self.sendline(cmd)
-            if re.search( "Error", handle ):
-                main.log.error("Error in adding point-to-point intent")
-=======
                 cmd += " " +\
                     str( egress_device ) + "/" +\
                     str( port_egress )
             print "cmd= ", cmd
-            self.handle.sendline( cmd )
-
-            main.log.info( cmd + " sent" )
-            i = self.handle.expect( [
-                "Error",
-                "onos>" ] )
-
-            if i == 0:
+            handle = self.sendline( cmd )
+            if re.search( "Error", handle ):
                 main.log.error( "Error in adding point-to-point intent" )
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
                 return self.handle
             else:
                 return main.TRUE
@@ -1603,47 +1175,23 @@
             main.cleanup()
             main.exit()
 
-<<<<<<< HEAD
-    def remove_intent(self, intent_id):
-        '''
+    def remove_intent( self, intent_id ):
+        """
         Remove intent for specified intent id
 
         Returns:
             main.False on error and
             cli output otherwise
-        '''
+        """
         try:
             cmd_str = "remove-intent " + str( intent_id )
             handle = self.sendline( cmd_str )
             if re.search( "Error", handle ):
-                main.log.error("Error in removing intent")
+                main.log.error( "Error in removing intent" )
                 return main.FALSE
             else:
                 # TODO: Should this be main.TRUE
                 return handle
-=======
-    def remove_intent( self, intent_id ):
-        """
-        Remove intent for specified intent id
-        """
-        try:
-            self.handle.sendline( "" )
-            self.handle.expect( "onos>" )
-
-            self.handle.sendline( "remove-intent " + str( intent_id ) )
-            i = self.handle.expect( [
-                "Error",
-                "onos>" ] )
-
-            handle = self.handle.before
-
-            if i == 0:
-                main.log.error( "Error in removing intent" )
-                return handle
-            else:
-                return handle
-
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
@@ -1656,16 +1204,10 @@
             main.cleanup()
             main.exit()
 
-<<<<<<< HEAD
-    def routes(self, json_format=False):
-        '''
-        NOTE: This method should be used after installing application:
-              onos-app-sdnip
-=======
-    # This method should be used after installing application: onos-app-sdnip
     def routes( self, json_format=False ):
         """
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
+        NOTE: This method should be used after installing application:
+              onos-app-sdnip
         Optional:
             * json_format: enable output formatting in json
         Description:
@@ -1673,32 +1215,13 @@
         """
         try:
             if json_format:
-<<<<<<< HEAD
                 cmd_str = "routes -j"
                 handle_tmp = self.sendline( cmd_str )
-                ansi_escape = re.compile(r'\r\r\n\x1b[^m]*m')
-                handle = ansi_escape.sub('', handle_tmp)
+                ansi_escape = re.compile( r'\r\r\n\x1b[^m]*m' )
+                handle = ansi_escape.sub( '', handle_tmp )
             else:
                 cmd_str = "routes"
                 handle = self.sendline( cmd_str )
-=======
-                self.handle.sendline( "routes -j" )
-                self.handle.expect( "routes -j" )
-                self.handle.expect( "onos>" )
-                handle_tmp = self.handle.before
-
-                ansi_escape = re.compile( r'\r\r\n\x1b[^m]*m' )
-                handle = ansi_escape.sub( '', handle_tmp )
-
-            else:
-                self.handle.sendline( "" )
-                self.handle.expect( "onos>" )
-
-                self.handle.sendline( "routes" )
-                self.handle.expect( "onos>" )
-                handle = self.handle.before
-
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
             return handle
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
@@ -1718,37 +1241,16 @@
             * json_format: enable output formatting in json
         Description:
             Obtain intents currently installed
-<<<<<<< HEAD
-        '''
+        """
         try:
             if json_format:
                 cmd_str = "intents -j"
                 handle = self.sendline( cmd_str )
-                ansi_escape = re.compile(r'\r\r\n\x1b[^m]*m')
-                handle = ansi_escape.sub('', handle)
-            else:
-                cmd_str = "intents"
-                handle = self.sendline( cmd_str )
-=======
-        """
-        try:
-            if json_format:
-                self.handle.sendline( "intents -j" )
-                self.handle.expect( "intents -j" )
-                self.handle.expect( "onos>" )
-                handle = self.handle.before
-
                 ansi_escape = re.compile( r'\r\r\n\x1b[^m]*m' )
                 handle = ansi_escape.sub( '', handle )
             else:
-                self.handle.sendline( "" )
-                self.handle.expect( "onos>" )
-
-                self.handle.sendline( "intents" )
-                self.handle.expect( "onos>" )
-                handle = self.handle.before
-
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
+                cmd_str = "intents"
+                handle = self.sendline( cmd_str )
             return handle
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
@@ -1768,42 +1270,19 @@
             * json_format: enable output formatting in json
         Description:
             Obtain flows currently installed
-<<<<<<< HEAD
-        '''
+        """
         try:
             if json_format:
                 cmd_str = "flows -j"
                 handle = self.sendline( cmd_str )
-                ansi_escape = re.compile(r'\r\r\n\x1b[^m]*m')
-                handle = ansi_escape.sub('', handle)
+                ansi_escape = re.compile( r'\r\r\n\x1b[^m]*m' )
+                handle = ansi_escape.sub( '', handle )
             else:
                 cmd_str = "flows"
                 handle = self.sendline( cmd_str )
-            if re.search("Error\sexecuting\scommand:", handle):
-                main.log.error( self.name + ".flows() response: " +
-                        str( handle ) )
-=======
-        """
-        try:
-            if json_format:
-                self.handle.sendline( "flows -j" )
-                self.handle.expect( "flows -j" )
-                self.handle.expect( "onos>" )
-                handle = self.handle.before
-                ansi_escape = re.compile( r'\r\r\n\x1b[^m]*m' )
-                handle = ansi_escape.sub( '', handle )
-
-            else:
-                self.handle.sendline( "" )
-                self.handle.expect( "onos>" )
-                self.handle.sendline( "flows" )
-                self.handle.expect( "onos>" )
-                handle = self.handle.before
             if re.search( "Error\sexecuting\scommand:", handle ):
-                main.log.error(
-                    self.name + ".flows() response: " + str( handle ) )
-
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
+                main.log.error( self.name + ".flows() response: " +
+                                str( handle ) )
             return handle
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
@@ -1817,15 +1296,9 @@
             main.cleanup()
             main.exit()
 
-<<<<<<< HEAD
-    def push_test_intents(self, dpid_src, dpid_dst, num_intents,
-            num_mult="", app_id="", report=True):
-        '''
-=======
     def push_test_intents( self, dpid_src, dpid_dst, num_intents,
                            num_mult="", app_id="", report=True ):
         """
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
         Description:
             Push a number of intents in a batch format to
             a specific point-to-point intent definition
@@ -1841,45 +1314,20 @@
             * report: default True, returns latency information
         """
         try:
-<<<<<<< HEAD
-            cmd = "push-test-intents "+\
-                  str(dpid_src)+" "+str(dpid_dst)+" "+\
-                  str(num_intents)
-            if num_mult:
-                cmd += " " + str(num_mult)
-                #If app id is specified, then num_mult
-                #must exist because of the way this command
-                #takes in arguments
-                if app_id:
-                    cmd += " " + str(app_id)
-            handle = self.sendline( cmd )
-            #Some color thing that we want to escape
-            ansi_escape = re.compile(r'\r\r\n\x1b[^m]*m')
-            handle = ansi_escape.sub('', handle)
-=======
             cmd = "push-test-intents " +\
                   str( dpid_src ) + " " + str( dpid_dst ) + " " +\
                   str( num_intents )
-
             if num_mult:
                 cmd += " " + str( num_mult )
                 # If app id is specified, then num_mult
                 # must exist because of the way this command
-                # takes in arguments
+                #takes in arguments
                 if app_id:
                     cmd += " " + str( app_id )
-
-            self.handle.sendline( cmd )
-            self.handle.expect( cmd )
-            self.handle.expect( "onos>" )
-
-            handle = self.handle.before
-
+            handle = self.sendline( cmd )
             # Some color thing that we want to escape
             ansi_escape = re.compile( r'\r\r\n\x1b[^m]*m' )
             handle = ansi_escape.sub( '', handle )
-
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
             if report:
                 lat_result = []
                 main.log.info( handle )
@@ -1889,18 +1337,10 @@
                 newline = newline[ 1: ]
                 # Some sloppy parsing method to get the latency
                 for result in newline:
-<<<<<<< HEAD
-                    result = result.split(": ")
-                    #Append the first result of second parse
-                    lat_result.append(result[1].split(" ")[0])
-                main.log.info(lat_result)
-=======
                     result = result.split( ": " )
                     # Append the first result of second parse
                     lat_result.append( result[ 1 ].split( " " )[ 0 ] )
-
                 main.log.info( lat_result )
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
                 return lat_result
             else:
                 return main.TRUE
@@ -1916,50 +1356,23 @@
             main.cleanup()
             main.exit()
 
-<<<<<<< HEAD
-    def intents_events_metrics(self, json_format=True):
-        '''
-=======
     def intents_events_metrics( self, json_format=True ):
         """
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
         Description:Returns topology metrics
         Optional:
             * json_format: enable json formatting of output
         """
         try:
             if json_format:
-<<<<<<< HEAD
                 cmd_str = "intents-events-metrics -j"
                 handle = self.sendline( cmd_str )
                 # Some color thing that we want to escape
-                ansi_escape = re.compile(r'\r\r\n\x1b[^m]*m')
-                handle = ansi_escape.sub('', handle)
+                ansi_escape = re.compile( r'\r\r\n\x1b[^m]*m' )
+                handle = ansi_escape.sub( '', handle )
             else:
                 cmd_str = "intents-events-metrics"
                 handle = self.sendline( cmd_str )
             return handle
-=======
-                self.handle.sendline( "intents-events-metrics -j" )
-                self.handle.expect( "intents-events-metrics -j" )
-                self.handle.expect( "onos>" )
-
-                handle = self.handle.before
-
-                # Some color thing that we want to escape
-                ansi_escape = re.compile( r'\r\r\n\x1b[^m]*m' )
-                handle = ansi_escape.sub( '', handle )
-
-            else:
-                self.handle.sendline( "intents-events-metrics" )
-                self.handle.expect( "intents-events-metrics" )
-                self.handle.expect( "onos>" )
-
-                handle = self.handle.before
-
-            return handle
-
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
@@ -1980,37 +1393,15 @@
         """
         try:
             if json_format:
-<<<<<<< HEAD
                 cmd_str = "topology-events-metrics -j"
                 handle = self.sendline( cmd_str )
-                #Some color thing that we want to escape
-                ansi_escape = re.compile(r'\r\r\n\x1b[^m]*m')
-                handle = ansi_escape.sub('', handle)
+                # Some color thing that we want to escape
+                ansi_escape = re.compile( r'\r\r\n\x1b[^m]*m' )
+                handle = ansi_escape.sub( '', handle )
             else:
                 cmd_str = "topology-events-metrics"
                 handle = self.sendline( cmd_str )
             return handle
-=======
-                self.handle.sendline( "topology-events-metrics -j" )
-                self.handle.expect( "topology-events-metrics -j" )
-                self.handle.expect( "onos>" )
-
-                handle = self.handle.before
-
-                # Some color thing that we want to escape
-                ansi_escape = re.compile( r'\r\r\n\x1b[^m]*m' )
-                handle = ansi_escape.sub( '', handle )
-
-            else:
-                self.handle.sendline( "topology-events-metrics" )
-                self.handle.expect( "topology-events-metrics" )
-                self.handle.expect( "onos>" )
-
-                handle = self.handle.before
-
-            return handle
-
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
@@ -2229,8 +1620,8 @@
                 output = output + \
                     "The number of links and switches does not match what was expected"
                 result = main.FALSE
-            output = output + "\n ONOS sees %i devices (%i expected) and %i links (%i expected)"\
-                % ( int( devices ), int( numoswitch ), int( links ), int( numolink ) )
+            output = output + "\n ONOS sees %i devices (%i expected) and %i links (%i expected)" % (
+                int( devices ), int( numoswitch ), int( links ), int( numolink ) )
             if log_level == "report":
                 main.log.report( output )
             elif log_level == "warn":
@@ -2257,59 +1648,28 @@
         onos_node is the ip of one of the onos nodes in the cluster
         role must be either master, standby, or none
 
-<<<<<<< HEAD
         Returns:
             main.TRUE or main.FALSE based on argument verification and
             main.ERROR if command returns and error
-        '''
+        """
         try:
             if role.lower() == "master" or role.lower() == "standby" or\
                     role.lower() == "none":
-                        cmd_str = "device-role " +\
-                                str(device_id) + " " +\
-                                str(onos_node) +  " " +\
-                                str(role)
-                        handle = self.sendline( cmd_str )
-                        if re.search( "Error", handle ):
-                            # end color output to escape any colours
-                            # from the cli
-                            main.log.error( self.name + ": " +\
-                                    handle + '\033[0m' )
-                            return main.ERROR
-                        return main.TRUE
-=======
-        Returns main.TRUE or main.FALSE based on argument verification.
-            When device-role supports errors this should be extended to
-            support that output
-        """
-        try:
-            # print "beginning device_role... \n\tdevice_id:" + device_id
-            # print "\tonos_node: " + onos_node
-            # print "\trole: "+ role
-            if role.lower() == "master" or \
-                    role.lower() == "standby" or \
-                    role.lower() == "none":
-                self.handle.sendline( "" )
-                self.handle.expect( "onos>" )
-                self.handle.sendline( "device-role " +
-                                      str( device_id ) + " " +
-                                      str( onos_node ) + " " +
-                                      str( role ) )
-                i = self.handle.expect( [ "Error", "onos>" ] )
-                if i == 0:
-                    output = str( self.handle.before )
-                    self.handle.expect( "onos>" )
-                    output = output + str( self.handle.before )
+                cmd_str = "device-role " +\
+                    str( device_id ) + " " +\
+                    str( onos_node ) +  " " +\
+                    str( role )
+                handle = self.sendline( cmd_str )
+                if re.search( "Error", handle ):
+                    # end color output to escape any colours
+                    # from the cli
                     main.log.error( self.name + ": " +
-                                    output + '\033[0m' )  # end color output to escape any colours from the cli
+                                    handle + '\033[0m' )
                     return main.ERROR
-                self.handle.sendline( "" )
-                self.handle.expect( "onos>" )
                 return main.TRUE
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
             else:
-                main.log.error("Invalid 'role' given to device_role(). " +
-                        "Value was '" + str( role ) + "'.")
+                main.log.error( "Invalid 'role' given to device_role(). " +
+                                "Value was '" + str(role) + "'." )
                 return main.FALSE
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
@@ -2330,60 +1690,28 @@
             * json_format - boolean indicating if you want output in json
         """
         try:
-<<<<<<< HEAD
             if json_format:
                 cmd_str = "clusters -j"
                 handle = self.sendline( cmd_str )
-                '''
+                """
                 handle variable here contains some ANSI escape color code
                 sequences at the end which are invisible in the print command
                 output. To make that escape sequence visible, use repr()
-                function. The repr(handle) output when printed shows the ANSI
-                escape sequences. In json.loads(somestring), this somestring
-                variable is actually repr(somestring) and json.loads would fail
+                function. The repr( handle ) output when printed shows the ANSI
+                escape sequences. In json.loads( somestring ), this somestring
+                variable is actually repr( somestring ) and json.loads would fail
                 with the escape sequence. So we take off that escape sequence
                 using:
 
-                ansi_escape = re.compile(r'\r\r\n\x1b[^m]*m')
-                handle1 = ansi_escape.sub('', handle)
-                '''
-                ansi_escape = re.compile(r'\r\r\n\x1b[^m]*m')
-                handle1 = ansi_escape.sub('', handle)
+                ansi_escape = re.compile( r'\r\r\n\x1b[^m]*m' )
+                handle1 = ansi_escape.sub( '', handle )
+                """
+                ansi_escape = re.compile( r'\r\r\n\x1b[^m]*m' )
+                handle1 = ansi_escape.sub( '', handle )
                 return handle1
             else:
                 cmd_str = "clusters"
                 handle = self.sendline( cmd_str )
-=======
-            self.handle.sendline( "" )
-            self.handle.expect( "onos>" )
-
-            if json_format:
-                self.handle.sendline( "clusters -j" )
-                self.handle.expect( "clusters -j" )
-                self.handle.expect( "onos>" )
-                handle = self.handle.before
-                """
-                handle variable here contains some ANSI escape color code
-                sequences at the end which are invisible in the print command
-                output. To make that escape sequence visible, use repr() function.
-                The repr( handle ) output when printed shows the ANSI escape sequences.
-                In json.loads( somestring ), this somestring variable is actually
-                repr( somestring ) and json.loads would fail with the escape sequence.
-                So we take off that escape sequence using
-                ansi_escape = re.compile( r'\r\r\n\x1b[^m]*m' )
-                handle1 = ansi_escape.sub( '', handle )
-                """
-                # print "repr(handle) =", repr( handle )
-                ansi_escape = re.compile( r'\r\r\n\x1b[^m]*m' )
-                handle1 = ansi_escape.sub( '', handle )
-                # print "repr(handle1) = ", repr( handle1 )
-                return handle1
-            else:
-                self.handle.sendline( "clusters" )
-                self.handle.expect( "onos>" )
-                handle = self.handle.before
-                # print "handle =",handle
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
                 return handle
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
@@ -2397,86 +1725,44 @@
             main.cleanup()
             main.exit()
 
-<<<<<<< HEAD
-    def election_test_leader(self):
-        '''
+    def election_test_leader( self ):
+        """
         CLI command to get the current leader for the Election test application
         NOTE: Requires installation of the onos-app-election feature
         Returns: Node IP of the leader if one exists
                  None if none exists
                  Main.FALSE on error
-        '''
+        """
         try:
             cmd_str = "election-test-leader"
             response = self.sendline( cmd_str )
             # Leader
             leaderPattern = "The\scurrent\sleader\sfor\sthe\sElection\s" +\
-                    "app\sis\s(?P<node>.+)\."
-            node_search = re.search(leaderPattern, response)
+                "app\sis\s(?P<node>.+)\."
+            node_search = re.search( leaderPattern, response )
             if node_search:
-                node = node_search.group('node')
+                node = node_search.group( 'node' )
                 main.log.info( "Election-test-leader on " + str( self.name ) +
-                        " found " + node + " as the leader" )
+                               " found " + node + " as the leader" )
                 return node
             # no leader
             nullPattern = "There\sis\scurrently\sno\sleader\selected\sfor\s" +\
-                    "the\sElection\sapp"
-            null_search = re.search(nullPattern, response)
+                "the\sElection\sapp"
+            null_search = re.search( nullPattern, response )
             if null_search:
                 main.log.info( "Election-test-leader found no leader on " +
-                        self.name )
+                               self.name )
                 return None
-            #error
+            # error
             errorPattern = "Command\snot\sfound"
-            if re.search(errorPattern, response):
-                main.log.error("Election app is not loaded on " + self.name)
+            if re.search( errorPattern, response ):
+                main.log.error( "Election app is not loaded on " + self.name )
                 # TODO: Should this be main.ERROR?
                 return main.FALSE
             else:
-                main.log.error("Error in election_test_leader: " +
-                        "unexpected response")
-                main.log.error( repr(response) )
-=======
-    def election_test_leader( self ):
-        """
-         * CLI command to get the current leader for the Election test application.
-         #NOTE: Requires installation of the onos-app-election feature
-         Returns: Node IP of the leader if one exists
-                  None if none exists
-                  Main.FALSE on error
-        """
-        try:
-            self.handle.sendline( "election-test-leader" )
-            self.handle.expect( "election-test-leader" )
-            self.handle.expect( "onos>" )
-            response = self.handle.before
-            # Leader
-            node_search = re.search(
-                "The\scurrent\sleader\sfor\sthe\sElection\sapp\sis\s(?P<node>.+)\.",
-                response )
-            if node_search:
-                node = node_search.group( 'node' )
-                main.log.info( "Election-test-leader on " + str(
-                    self.name ) + " found " + node + " as the leader" )
-                return node
-            # no leader
-            null_search = re.search(
-                "There\sis\scurrently\sno\sleader\selected\sfor\sthe\sElection\sapp",
-                response )
-            if null_search:
-                main.log.info(
-                    "Election-test-leader found no leader on " +
-                    self.name )
-                return None
-            # error
-            if re.search( "Command\snot\sfound", response ):
-                main.log.error( "Election app is not loaded on " + self.name )
-                return main.FALSE
-            else:
-                main.log.error(
-                    "Error in election_test_leader: unexpected response" )
+                main.log.error( "Error in election_test_leader: " +
+                                "unexpected response" )
                 main.log.error( repr( response ) )
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
                 return main.FALSE
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
@@ -2490,63 +1776,32 @@
             main.cleanup()
             main.exit()
 
-<<<<<<< HEAD
-    def election_test_run(self):
-        '''
+    def election_test_run( self ):
+        """
         CLI command to run for leadership of the Election test application.
         NOTE: Requires installation of the onos-app-election feature
         Returns: Main.TRUE on success
                  Main.FALSE on error
-        '''
+        """
         try:
             cmd_str = "election-test-run"
             response = self.sendline( cmd_str )
-            #success
+            # success
             successPattern = "Entering\sleadership\selections\sfor\sthe\s" +\
-                    "Election\sapp."
+                "Election\sapp."
             search = re.search( successPattern, response )
             if search:
                 main.log.info( self.name + " entering leadership elections " +
-                        "for the Election app." )
+                               "for the Election app." )
                 return main.TRUE
-            #error
+            # error
             errorPattern = "Command\snot\sfound"
             if re.search( errorPattern, response ):
                 main.log.error( "Election app is not loaded on " + self.name )
                 return main.FALSE
             else:
                 main.log.error( "Error in election_test_run: " +
-                        "unexpected response" )
-=======
-    def election_test_run( self ):
-        """
-         * CLI command to run for leadership of the Election test application.
-         #NOTE: Requires installation of the onos-app-election feature
-         Returns: Main.TRUE on success
-                  Main.FALSE on error
-        """
-        try:
-            self.handle.sendline( "election-test-run" )
-            self.handle.expect( "election-test-run" )
-            self.handle.expect( "onos>" )
-            response = self.handle.before
-            # success
-            search = re.search(
-                "Entering\sleadership\selections\sfor\sthe\sElection\sapp.",
-                response )
-            if search:
-                main.log.info(
-                    self.name +
-                    " entering leadership elections for the Election app." )
-                return main.TRUE
-            # error
-            if re.search( "Command\snot\sfound", response ):
-                main.log.error( "Election app is not loaded on " + self.name )
-                return main.FALSE
-            else:
-                main.log.error(
-                    "Error in election_test_run: unexpected response" )
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
+                                "unexpected response" )
                 main.log.error( repr( response ) )
                 return main.FALSE
         except pexpect.EOF:
@@ -2570,51 +1825,25 @@
                   Main.FALSE on error
         """
         try:
-<<<<<<< HEAD
             cmd_str = "election-test-withdraw"
             response = self.sendline( cmd_str )
-            #success
+            # success
             successPattern = "Withdrawing\sfrom\sleadership\selections\sfor" +\
-                    "\sthe\sElection\sapp."
+                "\sthe\sElection\sapp."
             if re.search( successPattern, response ):
                 main.log.info( self.name + " withdrawing from leadership " +
-                        "elections for the Election app." )
+                               "elections for the Election app." )
                 return main.TRUE
-            #error
+            # error
             errorPattern = "Command\snot\sfound"
             if re.search( errorPattern, response ):
                 main.log.error( "Election app is not loaded on " + self.name )
                 return main.FALSE
             else:
                 main.log.error( "Error in election_test_withdraw: " +
-                        "unexpected response" )
+                                "unexpected response" )
                 main.log.error( repr( response ) )
                 return main.FALSE
-=======
-            self.handle.sendline( "election-test-withdraw" )
-            self.handle.expect( "election-test-withdraw" )
-            self.handle.expect( "onos>" )
-            response = self.handle.before
-            # success
-            search = re.search(
-                "Withdrawing\sfrom\sleadership\selections\sfor\sthe\sElection\sapp.",
-                response )
-            if search:
-                main.log.info(
-                    self.name +
-                    " withdrawing from leadership elections for the Election app." )
-                return main.TRUE
-            # error
-            if re.search( "Command\snot\sfound", response ):
-                main.log.error( "Election app is not loaded on " + self.name )
-                return main.FALSE
-            else:
-                main.log.error(
-                    "Error in election_test_withdraw: unexpected response" )
-                main.log.error( repr( response ) )
-                return main.FALSE
-
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
@@ -2634,7 +1863,6 @@
         """
         try:
             dpid = str( dpid )
-<<<<<<< HEAD
             cmd_str = "onos:ports -e " + dpid + " | wc -l"
             output = self.sendline( cmd_str )
             if re.search( "No such device", output ):
@@ -2642,28 +1870,6 @@
                 return ( output, "Error" )
             else:
                 return output
-=======
-            self.handle.sendline( "" )
-            self.handle.expect( "onos>" )
-
-            self.handle.sendline( "onos:ports -e " + dpid + " | wc -l" )
-            i = self.handle.expect( [
-                "No such device",
-                "onos>" ] )
-
-            # self.handle.sendline( "" )
-            # self.handle.expect( "onos>" )
-
-            output = self.handle.before
-
-            if i == 0:
-                main.log.error( "Error in getting ports" )
-                return ( output, "Error" )
-            else:
-                result = output
-                return result
-
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
@@ -2681,38 +1887,14 @@
         Get the count of all enabled ports on a particular device/switch
         """
         try:
-<<<<<<< HEAD
-            dpid = str(dpid)
+            dpid = str( dpid )
             cmd_str = "onos:links " + dpid + " | grep ACTIVE | wc -l"
             output = self.sendline( cmd_str )
             if re.search( "No such device", output ):
-                main.log.error( "Error in getting ports ")
-                return ( output, "Error ")
+                main.log.error( "Error in getting ports " )
+                return ( output, "Error " )
             else:
                 return output
-=======
-            dpid = str( dpid )
-            self.handle.sendline( "" )
-            self.handle.expect( "onos>" )
-
-            self.handle.sendline(
-                "onos:links " +
-                dpid +
-                " | grep ACTIVE | wc -l" )
-            i = self.handle.expect( [
-                "No such device",
-                "onos>" ] )
-
-            output = self.handle.before
-
-            if i == 0:
-                main.log.error( "Error in getting ports" )
-                return ( output, "Error" )
-            else:
-                result = output
-                return result
-
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
@@ -2730,7 +1912,6 @@
         Return a list of all Intent IDs
         """
         try:
-<<<<<<< HEAD
             cmd_str = "onos:intents | grep id="
             output = self.sendline( cmd_str )
             if re.search( "Error", output ):
@@ -2738,25 +1919,6 @@
                 return ( output, "Error" )
             else:
                 return output
-=======
-            self.handle.sendline( "" )
-            self.handle.expect( "onos>" )
-
-            self.handle.sendline( "onos:intents | grep id=" )
-            i = self.handle.expect( [
-                "Error",
-                "onos>" ] )
-
-            output = self.handle.before
-
-            if i == 0:
-                main.log.error( "Error in getting ports" )
-                return ( output, "Error" )
-            else:
-                result = output
-                return result
-
->>>>>>> 8ec71447cf6f890345b6b3c29368d5bd3c29dd54
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
@@ -2768,4 +1930,3 @@
             main.log.info( self.name + " ::::::" )
             main.cleanup()
             main.exit()
-
diff --git a/TestON/drivers/common/cli/remotetestbed/floodlightclidriver.py b/TestON/drivers/common/cli/remotetestbed/floodlightclidriver.py
index 8b25b2f..10e7a85 100644
--- a/TestON/drivers/common/cli/remotetestbed/floodlightclidriver.py
+++ b/TestON/drivers/common/cli/remotetestbed/floodlightclidriver.py
@@ -1,14 +1,14 @@
 #!/usr/bin/env python
-'''
+"""
 Created on 12-Feb-2013
 
-@author: Anil Kumar (anilkumar.s@paxterrasolutions.com)
+author:: Anil Kumar ( anilkumar.s@paxterrasolutions.com )
 
 
     TestON is free software: you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     the Free Software Foundation, either version 2 of the License, or
-    (at your option) any later version.
+    ( at your option ) any later version.
 
     TestON is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -16,12 +16,11 @@
     GNU General Public License for more details.
 
     You should have received a copy of the GNU General Public License
-    along with TestON.  If not, see <http://www.gnu.org/licenses/>.		
+    along with TestON.  If not, see <http://www.gnu.org/licenses/>.
 
 
 FloodLightCliDriver is the basic driver which will handle the Mininet functions
-'''
-
+"""
 import pexpect
 import struct
 import fcntl
@@ -31,30 +30,44 @@
 import sys
 import time
 
-sys.path.append("../")
+sys.path.append( "../" )
 
 from drivers.common.cli.remotetestbeddriver import RemoteTestBedDriver
 
-class FloodLightCliDriver(RemoteTestBedDriver):
-    '''
-        FloodLightCliDriver is the basic driver which will handle the Mininet functions
-    '''
-    def __init__(self):
-        super(RemoteTestBedDriver, self).__init__()
-        
-    def connect(self,**connectargs):
-        for key in connectargs:
-            vars(self)[key] = connectargs[key]
-        
-        self.name = self.options['name']
 
-        self.handle = super(FloodLightCliDriver,self).connect(user_name = self.user_name, ip_address = self.ip_address,port = self.port, pwd = self.pwd)
-        if self.handle :
-            main.log.info("Connected "+self.name)
-            self.execute(cmd="\r",prompt="\$",timeout=10)
-            self.execute(cmd="cd /home/openflow/floodlight/",prompt="floodlight\$",timeout=3)
-            self.execute(cmd="java -jar target/floodlight.jar &",prompt="\$",timeout=3)
-            self.execute(cmd="\r",prompt="\$",timeout=10)
+class FloodLightCliDriver( RemoteTestBedDriver ):
+
+    """
+        FloodLightCliDriver is the basic driver which will handle the Mininet functions
+    """
+    def __init__( self ):
+        super( RemoteTestBedDriver, self ).__init__()
+
+    def connect( self, **connectargs ):
+        for key in connectargs:
+            vars( self )[ key ] = connectargs[ key ]
+
+        self.name = self.options[ 'name' ]
+
+        self.handle = super(
+            FloodLightCliDriver,
+            self ).connect(
+            user_name=self.user_name,
+            ip_address=self.ip_address,
+            port=self.port,
+            pwd=self.pwd )
+        if self.handle:
+            main.log.info( "Connected " + self.name )
+            self.execute( cmd="\r", prompt="\$", timeout=10 )
+            self.execute(
+                cmd="cd /home/openflow/floodlight/",
+                prompt="floodlight\$",
+                timeout=3 )
+            self.execute(
+                cmd="java -jar target/floodlight.jar &",
+                prompt="\$",
+                timeout=3 )
+            self.execute( cmd="\r", prompt="\$", timeout=10 )
             return self.handle
-        else :
+        else:
             return main.FALSE
diff --git a/TestON/drivers/common/cli/remotetestbed/necswitchdriver.py b/TestON/drivers/common/cli/remotetestbed/necswitchdriver.py
index f5e652a..07fb668 100644
--- a/TestON/drivers/common/cli/remotetestbed/necswitchdriver.py
+++ b/TestON/drivers/common/cli/remotetestbed/necswitchdriver.py
@@ -1,545 +1,757 @@
 class NEC:
+
     def __init__( self ):
         self.prompt = '(.*)'
-        self.timeout = 60 
+        self.timeout = 60
 
-    def show(self, *options, **def_args ):
-        '''Possible Options :['  access-filter  ', '  accounting  ', '  acknowledgments  ', '  auto-config  ', '  axrp  ', '  cfm  ', '  channel-group  ', '  clock  ', '  config-lock-status  ', '  cpu  ', '  dhcp  ', '  dot1x  ', '  dumpfile  ', '  efmoam  ', '  environment  ', '  file  ', '  flash  ', '  gsrp  ', '  history  ', '  igmp-snooping  ', '  interfaces  ', '  ip  ', '  ip-dual  ', '  ipv6-dhcp  ', '  license  ', '  lldp  ', '  logging  ', '  loop-detection  ', '  mac-address-table  ', '  mc  ', '  memory  ', '  mld-snooping  ', '  netconf  ', '  netstat  ', '  ntp  ', '  oadp  ', '  openflow  ', '  port  ', '  power  ', '  processes  ', '  qos  ', '  qos-flow  ', '  sessions  ', '  sflow  ', '  spanning-tree  ', '  ssh  ', '  system  ', '  tcpdump  ', '  tech-support  ', '  track  ', '  version  ', '  vlan  ', '  vrrpstatus  ', '  whoami  ']'''
-        arguments= ''
+    def show( self, *options, **def_args ):
+        "Possible Options :['  access-filter  ', '  accounting  ', '  acknowledgments  ', '  auto-config  ', '  axrp  ', '  cfm  ', '  channel-group  ', '  clock  ', '  config-lock-status  ', '  cpu  ', '  dhcp  ', '  dot1x  ', '  dumpfile  ', '  efmoam  ', '  environment  ', '  file  ', '  flash  ', '  gsrp  ', '  history  ', '  igmp-snooping  ', '  interfaces  ', '  ip  ', '  ip-dual  ', '  ipv6-dhcp  ', '  license  ', '  lldp  ', '  logging  ', '  loop-detection  ', '  mac-address-table  ', '  mc  ', '  memory  ', '  mld-snooping  ', '  netconf  ', '  netstat  ', '  ntp  ', '  oadp  ', '  openflow  ', '  port  ', '  power  ', '  processes  ', '  qos  ', '  qos-flow  ', '  sessions  ', '  sflow  ', '  spanning-tree  ', '  ssh  ', '  system  ', '  tcpdump  ', '  tech-support  ', '  track  ', '  version  ', '  vlan  ', '  vrrpstatus  ', '  whoami  ']"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute( cmd="show " + arguments, prompt=prompt, timeout=timeout )
         return main.TRUE
 
-    def show_ip(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_ip( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   ip   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   ip   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_mc(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_mc( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   mc   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   mc   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_cfm(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_cfm( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   cfm   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   cfm   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_ntp(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_ntp( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   ntp   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   ntp   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_ssh(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_ssh( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   ssh   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   ssh   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_qos(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_qos( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   qos   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   qos   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_cpu(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_cpu( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   cpu   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   cpu   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_vlan(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_vlan( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   vlan   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   vlan   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_lldp(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_lldp( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   lldp   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   lldp   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_dhcp(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_dhcp( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   dhcp   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   dhcp   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_axrp(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_axrp( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   axrp   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   axrp   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_oadp(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_oadp( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   oadp   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   oadp   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_gsrp(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_gsrp( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   gsrp   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   gsrp   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_port(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_port( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   port   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   port   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_file(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_file( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   file   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   file   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_power(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_power( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   power   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   power   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_clock(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_clock( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   clock   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   clock   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_dot1x(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_dot1x( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   dot1x   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   dot1x   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_sflow(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_sflow( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   sflow   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   sflow   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_track(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_track( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   track   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   track   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_flash(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_flash( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   flash   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   flash   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_system(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_system( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   system   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   system   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_whoami(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_whoami( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   whoami   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   whoami   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_efmoam(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_efmoam( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   efmoam   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   efmoam   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_memory(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_memory( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   memory   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   memory   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_tcpdump(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_tcpdump( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   tcpdump   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   tcpdump   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_history(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_history( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   history   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   history   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_logging(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_logging( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   logging   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   logging   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_license(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_license( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   license   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   license   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_netstat(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_netstat( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   netstat   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   netstat   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_version(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_version( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   version   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   version   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_netconf(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_netconf( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   netconf   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   netconf   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_ipdual(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_ipdual( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   ip-dual   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   ip-dual   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_sessions(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_sessions( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   sessions   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   sessions   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_qosflow(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_qosflow( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   qos-flow   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   qos-flow   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_openflow(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_openflow( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   openflow   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   openflow   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_dumpfile(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_dumpfile( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   dumpfile   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   dumpfile   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_ipv6dhcp(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_ipv6dhcp( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   ipv6-dhcp   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   ipv6-dhcp   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_processes(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_processes( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   processes   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   processes   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_vrrpstatus(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_vrrpstatus( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   vrrpstatus   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   vrrpstatus   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_interfaces(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_interfaces( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   interfaces   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   interfaces   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_environment(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_environment( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   environment   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   environment   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_autoconfig(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_autoconfig( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   auto-config   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   auto-config   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_techsupport(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_techsupport( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   tech-support   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   tech-support   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_mldsnooping(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_mldsnooping( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   mld-snooping   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   mld-snooping   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_igmpsnooping(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_igmpsnooping( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   igmp-snooping   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   igmp-snooping   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_channelgroup(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_channelgroup( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   channel-group   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   channel-group   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_spanningtree(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_spanningtree( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   spanning-tree   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   spanning-tree   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_loopdetection(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_loopdetection( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   loop-detection   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   loop-detection   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_acknowledgments(self, *options, **def_args ):
-        '''Possible Options :['  interface  ']'''
-        arguments= ''
+    def show_acknowledgments( self, *options, **def_args ):
+        "Possible Options :['  interface  ']"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   acknowledgments   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   acknowledgments   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_macaddresstable(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_macaddresstable( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   mac-address-table   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   mac-address-table   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_configlockstatus(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_configlockstatus( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   config-lock-status   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   config-lock-status   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
 
-    def show_acknowledgments_interface(self, *options, **def_args ):
-        '''Possible Options :[]'''
-        arguments= ''
+    def show_acknowledgments_interface( self, *options, **def_args ):
+        "Possible Options :[]"
+        arguments = ''
         for option in options:
-            arguments = arguments + option +' ' 
-        prompt = def_args.setdefault('prompt',self.prompt)
-        timeout = def_args.setdefault('timeout',self.timeout)
-        self.execute( cmd= "show   acknowledgments     interface   "+ arguments, prompt = prompt, timeout = timeout ) 
+            arguments = arguments + option + ' '
+        prompt = def_args.setdefault( 'prompt', self.prompt )
+        timeout = def_args.setdefault( 'timeout', self.timeout )
+        self.execute(
+            cmd="show   acknowledgments     interface   " +
+            arguments,
+            prompt=prompt,
+            timeout=timeout )
         return main.TRUE
-
