import csv
import datetime
import time
timestr = time.strftime("%Y-%m-%d") # add date to the file

def ASJModu(writtenfile,originalcsv):
    f1 = open(writtenfile, 'w')

    #subnet="/32"


    with open(originalcsv) as csvfile:
         reader = csv.DictReader(csvfile)

         for row in reader:
            source_service = row['Source']
            f1.write('set security zones security-zone INTERNET address-book address a_Akamai_' + source_service + ' ' + source_service + '\n')
            f1.write('set security zones security-zone INTERNET address-book address-set s_Akamai_Video address '+'a_Akamai_'+ source_service+'\n')
    f1.close()
    #for line in f.readlines():
    #    f1.write('set security zones security-zone DMZ_SLB address-book address a_LaCoAWS_'+line+' '+line+subnet+'\n')
    #    #print (linea)
    #f1.close()
    #f.close()

#output=input("please specify the output filename ")
inputcsv=input("Please specify the data CSV name: ")
filename=input("output file name is?")
ASJModu('Result/'+str(filename)+'-'+str(timestr)+'txt',inputcsv)