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

Zoning not returning rest response result #20

Open
shaunoconnor755 opened this issue Jan 17, 2023 · 0 comments
Open

Zoning not returning rest response result #20

shaunoconnor755 opened this issue Jan 17, 2023 · 0 comments

Comments

@shaunoconnor755
Copy link

brcd_zone_util.py does not return anything. It does a lot of printing - perhaps deliberately, perhaps only if under a debug/test run.
In order to catch zone delete errors, we should preserve the first fail before the cfgsave or cfgabort.

--- /opt/esm/Config/current/soc/git/pyfos/pyfos/utils/brcd_zone_util.py 2022-04-07 16:50:06.414032000 +0100
+++ brcd_zone_util.py 2023-01-17 17:52:31.244548000 +0000
@@ -57,8 +57,8 @@
if pyfos_util.is_failed_resp(result):
pyfos_util.response_print(result)
print(func.name, "failed. \n\nAborting transaction.")

  •    result = cfgabort.cfgabort(session)
    
  •    pyfos_util.response_print(result)
    
  •    res = cfgabort.cfgabort(session)
    
  •    pyfos_util.response_print(res)
    
    else:
    pyfos_util.response_print(result)
    print(func.name, "succeeded. \n\nSaving transaction.")
    @@ -66,8 +66,9 @@
    if pyfos_util.is_failed_resp(result):
    pyfos_util.response_print(result)
    print(func.name, "failed. \n\nAborting transaction.")
  •        result = cfgabort.cfgabort(session)
    
  •        pyfos_util.response_print(result)
    
  •        res = cfgabort.cfgabort(session)
    
  •        pyfos_util.response_print(res)
    
  •   return(result)
    

def zone_name_members_func(session, inputs, usage, func):
@@ -94,8 +95,8 @@
if pyfos_util.is_failed_resp(result):
pyfos_util.response_print(result)
print(func.name, "failed. \n\nAborting transaction.")

  •    result = cfgabort.cfgabort(session)
    
  •    pyfos_util.response_print(result)
    
  •    res = cfgabort.cfgabort(session)
    
  •    pyfos_util.response_print(res)
    
    else:
    pyfos_util.response_print(result)
    print(func.name, "succeeded. \n\nSaving transaction.")
    @@ -103,8 +104,9 @@
    if pyfos_util.is_failed_resp(result):
    pyfos_util.response_print(result)
    print(func.name, "failed. \n\nAborting transaction.")
  •        result = cfgabort.cfgabort(session)
    
  •        pyfos_util.response_print(result)
    
  •        res = cfgabort.cfgabort(session)
    
  •        pyfos_util.response_print(res)
    
  •   return(result)
    

def zone_name_func(session, inputs, usage, func):
@@ -124,8 +126,8 @@
if pyfos_util.is_failed_resp(result):
pyfos_util.response_print(result)
print(func.name, "failed. \n\nAborting transaction.")

  •    result = cfgabort.cfgabort(session)
    
  •    pyfos_util.response_print(result)
    
  •    res = cfgabort.cfgabort(session)
    
  •    pyfos_util.response_print(res)
    
    else:
    pyfos_util.response_print(result)
    print(func.name, "succeeded. \n\nSaving transaction.")
    @@ -133,5 +135,6 @@
    if pyfos_util.is_failed_resp(result):
    pyfos_util.response_print(result)
    print(func.name, "failed. \n\nAborting transaction.")
  •        result = cfgabort.cfgabort(session)
    
  •        pyfos_util.response_print(result)
    
  •        res = cfgabort.cfgabort(session)
    
  •        pyfos_util.response_print(res)
    
  •   return(result)
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant