Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[minor_changes] Added new module ndo_mac_sec_policy (DCNE-177 DCNE-74) #522

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
12 changes: 12 additions & 0 deletions plugins/module_utils/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@
NDO_API_VERSION_FORMAT = "/mso/api/{api_version}"
NDO_API_VERSION_PATH_FORMAT = "/mso/api/{api_version}/{path}"

NDO_CIPHER_SUITE_MAP = {
"128_gcm_aes": "128GcmAes",
"128_gcm_aes_xpn": "128GcmAesXpn",
"256_gcm_aes": "256GcmAes",
"256_gcm_aes_xpn": "256GcmAesXpn",
}

NDO_SECURITY_POLICY_MAP = {
"should_secure": "shouldSecure",
"must_secure": "mustSecure",
}

EPG_U_SEG_ATTR_TYPE_MAP = {
"ip": "ip",
"mac": "mac",
Expand Down
8 changes: 8 additions & 0 deletions plugins/module_utils/mso.py
Original file line number Diff line number Diff line change
Expand Up @@ -1602,6 +1602,14 @@ def nd_request(self, path, method=None, data=None, file=None, qs=None, prefix=""
self.fail_json(msg=msg)
return {}

def verify_time_format(self, date_time):
if date_time != "now" or date_time != "infinite":
try:
formatted_date_time = datetime.datetime.strptime(date_time, "%Y-%m-%d %H:%M:%S")
return str(formatted_date_time)
except ValueError:
return self.fail_json(msg="ERROR: The time must be in 'YYYY-MM-DD HH:MM:SS' format.")


def service_node_ref_str_to_dict(serviceNodeRefStr):
serviceNodeRefTokens = serviceNodeRefStr.split("/")
Expand Down
Loading
Loading