How to use the cvprac.cvp_client_errors.CvpApiError function in cvprac

To help you get started, we’ve selected a few cvprac examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ansible / ansible / lib / ansible / modules / network / cloudvision / cv_server_provision.py View on Github external
if module.params['auto_run'] and module.params['action'] != 'show':
            task_id = configlet_update_task(module)
            if task_id:
                result['taskId'] = task_id
                note = ('Update config on %s with %s action from Ansible.'
                        % (module.params['switch_name'],
                           module.params['action']))
                module.client.api.add_note_to_task(task_id, note)
                module.client.api.execute_task(task_id)
                result['taskExecuted'] = True
                task_completed = wait_for_task_completion(module, task_id)
                if task_completed:
                    result['taskCompleted'] = True
            else:
                result['taskCreated'] = False
    except CvpApiError as e:
        module.fail_json(msg=str(e))

    module.exit_json(**result)

cvprac

Arista Cloudvision(R) Portal Rest API Client written in python

BSD-3-Clause
Latest version published 7 months ago

Package Health Score

59 / 100
Full package analysis

Similar packages