Giter Club home page Giter Club logo

teflo_openstack_client_plugin's Introduction

Teflo OpenstackClient Plugin

The Teflo OpenstackClient Plugin provides a provisioner that utilizes the openstackclient to provision resources for scenarios.

Read more at Teflo OpenstackClient Plugin Documentation

For more information on Teflo refer here

teflo_openstack_client_plugin's People

Contributors

junqizhang0 avatar rujutashinde avatar shay6 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

teflo_openstack_client_plugin's Issues

" AttributeError: 'str' object has no attribute 'get' " while attaching a volume to the instance using server_add_volume

While attaching a volume to the instance using server_add_volume, got the below error

File "/home/user/teflo/lib/python3.6/site-packages/teflo_openstack_client_plugin/helpers/os_client_helper.py", line 132, in parse_network_addresses_to_dict
if json_resp.get('addresses', {}):
AttributeError: 'str' object has no attribute 'get'

The content of the scenario.yml file is

provision:
  - name: test_voll
    provisioner: openstack-client
    volume:
      size: 5
    credential: openstack

  - name: teflo_clit
    groups: client, test_driver
    provisioner: openstack-client
    credential: openstack
    server:
      key_name: os
      image: RHEL-8.5.0-x86_64-released
      flavor: m1.small
      network:
        - provider_net_cci_8
    server_add_volume:
      - device: /dev/vdb
        tgt_res: test_voll
      
    ansible_params:
      ansible_user: cloud-user
      ansible_ssh_private_key_file:  keys/keys

The volumes are attached to the instances but the result is failed and the above error is displayed

While creating multiple volumes, some commands are called without name parameter value

While creating multiple volumes, some commands are called without name value:

provision:
  - name: ceph-node-volume
    provisioner: openstack-client
    credential: openstack-creds
    volume:
      max: 4
      size: 20
2022-04-07 14:26:08,833 INFO [teflo_openstack_client_plugin.os_client_provisioner.create:345] Provisioning Asset ceph-node-volume.
2022-04-07 14:26:08,837 INFO [ospclientsdk.load_cloud_config:71] Successfully loaded cloud credentials.
2022-04-07 14:26:08,838 DEBUG [ospclientsdk.func:134] {'size': 20, 'res': 'ceph-node-volume-1'}
2022-04-07 14:26:08,838 DEBUG [ospclientsdk.helpers.decorators.run_cmd_raw:100] command: openstack volume create --size 20 ceph-node-volume-1 -f json
2022-04-07 14:26:08,838 DEBUG [ospclientsdk.func:134] {'size': 20, 'res': 'ceph-node-volume-2'}
2022-04-07 14:26:08,839 DEBUG [ospclientsdk.func:134] {'size': 20, 'res': 'ceph-node-volume-2'}
2022-04-07 14:26:08,839 DEBUG [ospclientsdk.helpers.decorators.run_cmd_raw:100] command: openstack volume create --size 20 ceph-node-volume-2 -f json
2022-04-07 14:26:08,839 DEBUG [ospclientsdk.func:134] {'size': 20}
2022-04-07 14:26:08,839 DEBUG [ospclientsdk.helpers.decorators.run_cmd_raw:100] command: openstack volume create --size 20 ceph-node-volume-4 -f json
2022-04-07 14:26:08,842 DEBUG [ospclientsdk.helpers.decorators.run_cmd_raw:100] command: openstack volume create --size 20  -f json
2022-04-07 14:26:10,333 ERROR [teflo_openstack_client_plugin.os_client_provisioner._run_action:329] Command did not execute successfully
2022-04-07 14:26:11,808 ERROR [teflo.provisioners.asset_provisioner.create:150] usage: openstack volume create [-h] [-f {json,shell,table,value,yaml}]
                               [-c COLUMN] [--noindent] [--prefix PREFIX]
                               [--max-width <integer>] [--fit-width]
                               [--print-empty] [--size <size>]
                               [--type <volume-type>]
                               [--image <image> | --snapshot <snapshot> | --source <volume>]
                               [--description <description>]
                               [--availability-zone <availability-zone>]
                               [--consistency-group consistency-group>]
                               [--property <key=value>] [--hint <key=value>]
                               [--bootable | --non-bootable]
                               [--read-only | --read-write]
                               <name>
openstack volume create: error: the following arguments are required: <name>
$ teflo --version
teflo, version 2.2.3

$ pip show python-openstackclient
Name: python-openstackclient
Version: 5.8.0

python-openstackclient 5.5.0 breaks teflo_openstack_client_plugin

Teflo no longer works with python-openstackclient 5.5.0 released over this past weekend. The behavior of the client library with respect to networks has changed, as per this release note from the library:

"The networks and properties fields of the server list command will now be rendered as objects. In addition, the power_state field will now be humanized and rendered as a string value when using the table formatter."

This leads to the following error during provisioning:

2021-03-23 10:00:31,807 ERROR [teflo.tasks.provision.run:67] Failed to provision asset psi-c0-osp16-test-autobot-ceph-mon
2021-03-23 10:00:31,808 ERROR [teflo.tasks.provision.run:69] 'dict' object has no attribute 'replace'
2021-03-23 10:00:31,809 ERROR [blaster.blast.run:90] A exception was raised while processing task: psi-c0-osp16-test-autobot-ceph-mon method: run
Traceback (most recent call last):
  File "/var/home/ghelling/src/oasis/C0/.tox/teflo/lib/python3.9/site-packages/blaster/blast.py", line 83, in run
    value = getattr(task_obj, method)()
  File "/var/home/ghelling/src/oasis/C0/.tox/teflo/lib/python3.9/site-packages/teflo/tasks/provision.py", line 65, in run
    return self.provisioner.create()
  File "/var/home/ghelling/src/oasis/C0/.tox/teflo/lib/python3.9/site-packages/teflo/provisioners/asset_provisioner.py", line 86, in create
    res = self.plugin.create()
  File "/var/home/ghelling/src/oasis/C0/.tox/teflo/lib/python3.9/site-packages/teflo_openstack_client_plugin/os_client_provisioner.py", line 363, in create
    results.extend(self._process_create_results(result, cp_opt, name))
  File "/var/home/ghelling/src/oasis/C0/.tox/teflo/lib/python3.9/site-packages/teflo_openstack_client_plugin/os_client_provisioner.py", line 226, in _process_create_results
    resp = generate_cbn_response(resp, self.config_params.get('public_network', None))
  File "/var/home/ghelling/src/oasis/C0/.tox/teflo/lib/python3.9/site-packages/teflo_openstack_client_plugin/helpers/os_client_helper.py", line 109, in generate_cbn_response
    ip_add = parse_network_addresses_to_dict(r, public_net_key)
  File "/var/home/ghelling/src/oasis/C0/.tox/teflo/lib/python3.9/site-packages/teflo_openstack_client_plugin/helpers/os_client_helper.py", line 133, in parse_network_addresses_to_dict
    addresses = json_resp.get('addresses').replace(' ', '').split(';')
AttributeError: 'dict' object has no attribute 'replace'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.