Fix the letsencrypt script to actually ignore "no action" notifications
This commit is contained in:
		
					parent
					
						
							
								782f3202e3
							
						
					
				
			
			
				commit
				
					
						432a5614dd
					
				
			
		
					 1 changed files with 12 additions and 12 deletions
				
			
		| 
						 | 
					@ -6,8 +6,6 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from enum import Enum
 | 
					from enum import Enum
 | 
				
			||||||
import fileinput
 | 
					import fileinput
 | 
				
			||||||
import sys
 | 
					 | 
				
			||||||
import select
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
import drymail  # Vendored
 | 
					import drymail  # Vendored
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -44,16 +42,18 @@ def main():
 | 
				
			||||||
        elif "unexpected error occurred" in line:
 | 
					        elif "unexpected error occurred" in line:
 | 
				
			||||||
            state = State.error
 | 
					            state = State.error
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if state is not State.no_action:
 | 
					    if state is State.no_action:
 | 
				
			||||||
        text = "\n".join(text)
 | 
					        return
 | 
				
			||||||
        subject = SUBJECT.format(str(state))
 | 
					
 | 
				
			||||||
        message = drymail.Message(
 | 
					    text = "\n".join(text)
 | 
				
			||||||
            sender=("Certbot renewal bot", "notify@dennogumi.org"),
 | 
					    subject = SUBJECT.format(str(state))
 | 
				
			||||||
            receivers=["root"],
 | 
					    message = drymail.Message(
 | 
				
			||||||
            subject=subject,
 | 
					        sender=("Certbot renewal bot", "notify@dennogumi.org"),
 | 
				
			||||||
            headers=HEADER,
 | 
					        receivers=["root"],
 | 
				
			||||||
            text=text
 | 
					        subject=subject,
 | 
				
			||||||
        )
 | 
					        headers=HEADER,
 | 
				
			||||||
 | 
					        text=text
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    client = drymail.SMTPMailer(
 | 
					    client = drymail.SMTPMailer(
 | 
				
			||||||
        host='localhost')
 | 
					        host='localhost')
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue