added some checks regarding output delimiter

This commit is contained in:
Ralf Mellis 2023-08-20 11:44:59 +02:00
parent 2cc5e0f703
commit 790d5b8e48

View File

@ -221,7 +221,7 @@ def getMailcowInfo(headers, verify, base_url):
Output is as follows:
mailbox name email address used for login
active 1 --> active, 0 --> not active
creation date
creation date "None" if ???
last modified date "None" if never modified
name display name
number of messages
@ -245,6 +245,8 @@ def doCmkOutputMailboxes():
created = mailbox_data[mb]["created"]
modified = mailbox_data[mb]["modified"]
name = mailbox_data[mb]["name"]
# strip semicolons, if present, since we use it as delimiter
name = name.replace(";", "")
num_messages = mailbox_data[mb]["num_messages"]
percent_in_use = mailbox_data[mb]["percent_in_use"]
quota = mailbox_data[mb]["quota"]
@ -257,6 +259,8 @@ def doCmkOutputMailboxes():
def doCmkOutputMailcow(version, num_domains, num_mailboxes, num_global_messages):
print("<<<mailcow_info:sep(59)>>>")
# strip semicolons, if present, since we use it as delimiter
version = version.replace(";", "")
print(f"{version};{num_domains};{num_mailboxes};{num_global_messages}")
@ -264,7 +268,7 @@ def doCmkOutputMailcow(version, num_domains, num_mailboxes, num_global_messages)
Output is as follows:
domain_name
active 1 --> active, 0 --> not active
creation date
creation date "None" if ???
last modified date "None" if never modified
max number mailboxes
number of mailboxes