mirror of
				https://github.com/SnowMB/traefik-certificate-extractor.git
				synced 2025-11-04 03:45:36 +08:00 
			
		
		
		
	fixes
This commit is contained in:
		@@ -3,7 +3,7 @@ import os
 | 
				
			|||||||
import errno
 | 
					import errno
 | 
				
			||||||
import time
 | 
					import time
 | 
				
			||||||
import json
 | 
					import json
 | 
				
			||||||
#import docker
 | 
					import docker
 | 
				
			||||||
import argparse
 | 
					import argparse
 | 
				
			||||||
from argparse import ArgumentTypeError as err
 | 
					from argparse import ArgumentTypeError as err
 | 
				
			||||||
from base64 import b64decode
 | 
					from base64 import b64decode
 | 
				
			||||||
@@ -73,14 +73,14 @@ class PathType(object):
 | 
				
			|||||||
        return string
 | 
					        return string
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def restartContainerWithDomain(domains):
 | 
					def restartContainerWithDomains(domains):
 | 
				
			||||||
    client = docker.from_env()
 | 
					    client = docker.from_env()
 | 
				
			||||||
    container = client.containers.list(filters = {"label" : "com.github.SnowMB.traefik-certificate-extractor.restart_domain"})
 | 
					    container = client.containers.list(filters = {"label" : "com.github.SnowMB.traefik-certificate-extractor.restart_domain"})
 | 
				
			||||||
    for c in container:
 | 
					    for c in container:
 | 
				
			||||||
        restartDomains = str.split(c.labels["com.github.SnowMB.traefik-certificate-extractor.restart_domain"], ',')
 | 
					        restartDomains = str.split(c.labels["com.github.SnowMB.traefik-certificate-extractor.restart_domain"], ',')
 | 
				
			||||||
        if not domains.isdisjoint(restartDomains):
 | 
					        if not set(domains).isdisjoint(restartDomains):
 | 
				
			||||||
            print('restarting container ' + c.id)
 | 
					            print('restarting container ' + c.id)
 | 
				
			||||||
            c.restart()
 | 
					#            c.restart()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def createCerts(file, directory, flat):
 | 
					def createCerts(file, directory, flat):
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,2 +1,2 @@
 | 
				
			|||||||
watchdog
 | 
					watchdog3
 | 
				
			||||||
docker
 | 
					docker
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user