Merge "Add `area of networking team`"
diff --git a/daily_jenkins_job_report/daily_report/config.py b/daily_jenkins_job_report/daily_report/config.py
index 0143cc1..4ea0949 100644
--- a/daily_jenkins_job_report/daily_report/config.py
+++ b/daily_jenkins_job_report/daily_report/config.py
@@ -12,6 +12,15 @@
 GENERATED_REPORT = '/var/www/oscore_jobs.com/html/reports/'
 REPORT_TEMPLATE = '/home/ubuntu/osccore-qa-testing-tools/daily_jenkins_job_report/daily_report/templates/report_template.html'
 
+LIST_OF_COLUMNS = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
+                   'M', 'N',
+                   'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
+                   'AB', 'AC',
+                   'AD', 'AE', 'AF', 'AG', 'AH', 'AI', 'AJ', 'AK', 'AL', 'AM',
+                   'AN', 'AO',
+                   'AP', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AV', 'AW', 'AX', 'AY',
+                   'AZ', 'BA']
+
 # For generating report
 MULTIJOBS = ['oscore-oscc-ci',
              'oscore-promote-openstack-pike-xenial',
diff --git a/daily_jenkins_job_report/daily_report/update_google_sheets.py b/daily_jenkins_job_report/daily_report/update_google_sheets.py
index c41880a..8c31fa4 100644
--- a/daily_jenkins_job_report/daily_report/update_google_sheets.py
+++ b/daily_jenkins_job_report/daily_report/update_google_sheets.py
@@ -1,6 +1,5 @@
 import config
 import generate_report
-
 from datetime import datetime, timedelta
 
 import gspread
@@ -47,6 +46,9 @@
 
                         if not self.wks.acell(cell).value:
                             self.wks.update_acell(cell, upd['build_status'])
+                            if upd['full_job_name'] == 'oscore-oscc-ci_openstack-ovs-core-octavia-pike' or upd['full_job_name'] == 'oscore-oscc-ci_openstack-ovs-core-octavia-queens':
+                                network_team_cell = get_network_team_cell(column_to_update, gs['row_number'])
+                                self.wks.update_acell(network_team_cell, 'Area of networking team')
 
                     if gs['gs_job_name'] == upd['full_job_name'] and upd['build_status'] != 'None' and check_datetime_today(upd['timestamp']):
                         cell = column_to_update + str(gs['row_number'])
@@ -58,6 +60,9 @@
 
                         if not self.wks.acell(cell).value:
                             self.wks.update_acell(cell, upd['build_status'])
+                            if upd['full_job_name'] == 'oscore-oscc-ci_openstack-ovs-core-octavia-pike' or upd['full_job_name'] == 'oscore-oscc-ci_openstack-ovs-core-octavia-queens':
+                                network_team_cell = get_network_team_cell(column_to_update, gs['row_number'])
+                                self.wks.update_acell(network_team_cell, 'Area of networking team')
 
                     elif ("oscore-oscc-ci" not in upd['full_job_name']) and gs['gs_job_name'] == upd['full_job_name'] and upd['build_status'] != 'None' and not check_datetime_today(upd['timestamp']):
                         cell = column_to_update + str(gs['row_number'])
@@ -66,6 +71,9 @@
 
                         if not self.wks.acell(cell).value:
                             self.wks.update_acell(cell, 'NOT EXEQUTED')
+                            if upd['full_job_name'] == 'oscore-oscc-ci_openstack-ovs-core-octavia-pike' or upd['full_job_name'] == 'oscore-oscc-ci_openstack-ovs-core-octavia-queens':
+                                network_team_cell = get_network_team_cell(column_to_update, gs['row_number'])
+                                self.wks.update_acell(network_team_cell, 'Area of networking team')
 
     def get_all_gs_jobs(self, column_number='A'):
         """
@@ -87,11 +95,8 @@
         If they are the same, returns column value from the list_of_columns
         """
         logger.info('Getting date from gs')
-        list_of_columns = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
-                           'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'AB', 'AC',
-                           'AD', 'AE', 'AF', 'AG', 'AH', 'AI', 'AJ', 'AK', 'AL', 'AM', 'AN', 'AO',
-                           'AP', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AV', 'AW', 'AX', 'AY', 'AZ', 'BA']
-        for i in list_of_columns:
+
+        for i in config.LIST_OF_COLUMNS:
             cell = i + '3'
             now = datetime.now()
             if self.wks.acell(cell).value == now.strftime("%Y-%m-%d"):
@@ -99,6 +104,12 @@
                 return i
 
 
+def get_network_team_cell(column_to_update, row_number):
+    column_to_update_index = config.LIST_OF_COLUMNS.index(column_to_update) + 1
+    cell = config.LIST_OF_COLUMNS[column_to_update_index] + str(row_number)
+    return cell
+
+
 def update_multy_job_names(results):
     """
     Fron Jenkins we get job names and job URLS.
@@ -133,6 +144,7 @@
     # Returns True or False
     return to_date_obj.date() == today
 
+
 def update_google_sheet(all_jobs_results):
     """
     The main function for updating google sheets.