Merge branch 'ONOS-Next' of https://github.com/OPENNETWORKINGLAB/ONLabTest into ONOS-Next
diff --git a/TestON/drivers/common/cli/onosdriver.py b/TestON/drivers/common/cli/onosdriver.py
index 7498879..e6d699c 100644
--- a/TestON/drivers/common/cli/onosdriver.py
+++ b/TestON/drivers/common/cli/onosdriver.py
@@ -356,6 +356,34 @@
             main.cleanup()
             main.exit()
 
+    def get_version(self):
+        '''
+        Writes the COMMIT number to the report to be parsed by Jenkins data collecter.
+        '''
+        try:
+            self.handle.sendline("export TERM=xterm-256color")
+            self.handle.expect("xterm-256color")
+            self.handle.expect("\$")
+            self.handle.sendline("cd " + self.home + "; git log -1 --pretty=fuller --decorate=short | grep -A 5 \"commit\" --color=never; cd \.\.")
+            self.handle.expect("cd ..")
+            self.handle.expect("\$")
+            response=(self.name +": \n"+ str(self.handle.before + self.handle.after))
+            lines=response.splitlines()
+            for line in lines:
+                print line
+            return lines[2]
+        except pexpect.EOF:
+            main.log.error(self.name + ": EOF exception found")
+            main.log.error(self.name + ":     " + self.handle.before)
+            main.cleanup()
+            main.exit()
+        except:
+            main.log.info(self.name + ":::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::")
+            main.log.error( traceback.print_exc() )
+            main.log.info(":::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::")
+            main.cleanup()
+            main.exit()
+
     def create_cell_file(self, bench_ip, file_name, mn_ip_addrs, *onos_ip_addrs):
         '''
         Creates a cell file based on arguments