@@ -58,6 +58,7 @@ CON.autocommit = True
5858
5959RT = rt .Rt (CONFIG ['rt' ]['uri' ], CONFIG ['rt' ]['user' ], CONFIG ['rt' ]['password' ])
6060
61+
6162QUERY_COUNT_ASN = """
6263SELECT
6364 COUNT(*) as count,
@@ -291,7 +292,7 @@ Subject: {subj}
291292 query_by_as (contact , show_table = True , requestor = requestor )
292293 return
293294 elif answer == ('r' ):
294- answer = input (inverted ('New requestor address: ' ) ).strip ()
295+ answer = input (inverted ('New requestor address:' ) + ' ' ).strip ()
295296 if len (answer ) == 0 :
296297 if type (contact ) is int :
297298 requestor = ''
@@ -389,11 +390,12 @@ def save_to_rt(ids, subject, requestor, csvfile, body):
389390 return
390391
391392 # TODO: CC
392- correspond = RT .comment (investigation_id , text = body ,
393- files = [(filename , attachment )])
393+ correspond = RT .reply (investigation_id , text = body ,
394+ files = [(filename , attachment )])
394395 if not correspond :
395396 print (red ('Could not correspond with text and file.' ))
396397 return
398+ print (green ('Correspondence added to Investigation.' ))
397399
398400 CUR .execute (QUERY_SET_RTIRID .format (ids = ',' .join (ids ),
399401 rtirid = investigation_id ,
@@ -434,7 +436,11 @@ def count_by_asn():
434436
435437if __name__ == '__main__' :
436438 if not RT .login ():
437- print (red ('Could not login to RT.' ))
439+ print (red ('Could not login as {} on {}.' .format (CONFIG ['rt' ]['user' ],
440+ CONFIG ['rt' ]['uri' ])))
441+ else :
442+ print ('Logged in as {} on {}.' .format (CONFIG ['rt' ]['user' ],
443+ CONFIG ['rt' ]['uri' ]))
438444 try :
439445 while True :
440446 asn_count = count_by_asn ()
0 commit comments