Support getting a service by name
This commit is contained in:
parent
65b7050930
commit
fb14d65878
1 changed files with 7 additions and 0 deletions
|
@ -173,6 +173,13 @@ class RunningContainers:
|
||||||
# """Host mapped volumes"""
|
# """Host mapped volumes"""
|
||||||
# return set(mnt for mnt in self.gen_volumes(VOLUME_TYPE_BIND))
|
# return set(mnt for mnt in self.gen_volumes(VOLUME_TYPE_BIND))
|
||||||
|
|
||||||
|
def get_service(self, name):
|
||||||
|
for container in self.containers:
|
||||||
|
if container.service_name == name:
|
||||||
|
return container
|
||||||
|
|
||||||
|
return None
|
||||||
|
|
||||||
def print_services(self):
|
def print_services(self):
|
||||||
print()
|
print()
|
||||||
print("Backup config for compose project '{}'".format(self.this_container.project_name))
|
print("Backup config for compose project '{}'".format(self.this_container.project_name))
|
||||||
|
|
Loading…
Add table
Reference in a new issue