mirror of
https://gitlab.sectorq.eu/jaydee/portainer.git
synced 2026-01-29 04:49:44 +01:00
Compare commits
11 Commits
2dc800f7f9
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 8ba22f79b9 | |||
| ddeb67750f | |||
| 12ff88f8e8 | |||
| 9d27e804a5 | |||
| 1f0a19b7b1 | |||
| 5adfbbcf3d | |||
| 0dda82be87 | |||
| 1a54c1e341 | |||
| 8d4bd382ee | |||
|
|
96068d4fb3 | ||
|
|
de37276ab6 |
14
main.py
14
main.py
@@ -26,7 +26,8 @@ from prompt_toolkit.shortcuts import checkboxlist_dialog
|
|||||||
from prompt_toolkit.shortcuts import radiolist_dialog
|
from prompt_toolkit.shortcuts import radiolist_dialog
|
||||||
|
|
||||||
|
|
||||||
VAULT_ADDR = os.environ.get("VAULT_ADDR", "http://192.168.77.101:8200")
|
# VAULT_ADDR = os.environ.get("VAULT_ADDR", "http://192.168.77.101:8200")
|
||||||
|
VAULT_ADDR = os.environ.get("VAULT_ADDR", "https://vault.sectorq.eu")
|
||||||
try:
|
try:
|
||||||
VAULT_TOKEN = os.environ.get("VAULT_TOKEN")
|
VAULT_TOKEN = os.environ.get("VAULT_TOKEN")
|
||||||
if VAULT_TOKEN is None:
|
if VAULT_TOKEN is None:
|
||||||
@@ -43,7 +44,7 @@ else:
|
|||||||
raise Exception("Failed to authenticate with Vault")
|
raise Exception("Failed to authenticate with Vault")
|
||||||
# Specify the mount point of your KV engine
|
# Specify the mount point of your KV engine
|
||||||
|
|
||||||
VERSION = "0.1.53"
|
VERSION = "0.1.55"
|
||||||
|
|
||||||
defaults = {
|
defaults = {
|
||||||
"endpoint_id": "vm01",
|
"endpoint_id": "vm01",
|
||||||
@@ -409,18 +410,13 @@ if __name__ == "__main__":
|
|||||||
]
|
]
|
||||||
|
|
||||||
selected_action = radiolist_dialog(
|
selected_action = radiolist_dialog(
|
||||||
title="Select one service",
|
title=f"Select one service - version: {VERSION}",
|
||||||
text="Choose a service:",
|
text="Choose a service:",
|
||||||
values=actions
|
values=actions
|
||||||
).run()
|
).run()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
print("Selected:", selected_action)
|
print("Selected:", selected_action)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# print("Possible actions: \n")
|
# print("Possible actions: \n")
|
||||||
# i = 1
|
# i = 1
|
||||||
# for a in actions:
|
# for a in actions:
|
||||||
|
|||||||
@@ -972,7 +972,14 @@ class PortainerApi:
|
|||||||
|
|
||||||
def update_service(self):
|
def update_service(self):
|
||||||
all_services = self.get_services(self.get_endpoint_id())
|
all_services = self.get_services(self.get_endpoint_id())
|
||||||
#input(all_services)
|
if self.args.debug:
|
||||||
|
print(all_services)
|
||||||
|
if all_services == 503:
|
||||||
|
print("No services found on this endpoint.")
|
||||||
|
return False
|
||||||
|
if len(all_services) == 0:
|
||||||
|
print("No services found on this endpoint.")
|
||||||
|
return False
|
||||||
service_tuples = [(s['ID'], s['Spec']['Name']) for s in all_services]
|
service_tuples = [(s['ID'], s['Spec']['Name']) for s in all_services]
|
||||||
service_tuples = sorted(service_tuples, key=lambda x: x[1])
|
service_tuples = sorted(service_tuples, key=lambda x: x[1])
|
||||||
service_dict = dict(service_tuples)
|
service_dict = dict(service_tuples)
|
||||||
|
|||||||
Reference in New Issue
Block a user