Bug 1018904
| Summary: | call to ClusterGlusterVolumeBricks::add() successfully adds brick to volume but throws exception | ||
|---|---|---|---|
| Product: | [Red Hat Storage] Red Hat Gluster Storage | Reporter: | Dustin Tsang <dtsang> |
| Component: | rhsc-sdk | Assignee: | Darshan <dnarayan> |
| Status: | CLOSED ERRATA | QA Contact: | Dustin Tsang <dtsang> |
| Severity: | high | Docs Contact: | |
| Priority: | medium | ||
| Version: | 2.1 | CC: | dnarayan, dpati, dtsang, knarra, mmahoney, mmccune, pprakash, rhs-bugs, sharne, ssampat |
| Target Milestone: | --- | Keywords: | ZStream |
| Target Release: | RHGS 2.1.2 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | cb11 | Doc Type: | Bug Fix |
| Doc Text: |
Previously, adding bricks was successful, but an error message was displayed. Now, the error message is not displayed.
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2014-02-25 07:51:23 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
Please share the snippet used to add brick. Here is the working example # ---------------------------------------------------------------------------- from ovirtsdk.api import API from ovirtsdk.xml import params ENGINE="https://10.70.42.247/api" USERNAME="admin@internal" PASSWORD=<password> INSECURE=True CLUSTER_NAME="Default" VOLNAME = "vol1" BRICK_DIR="/export/vol1-h" BRICK_SERVER="10.70.42.165" api = API(url=ENGINE, username=USERNAME, password=PASSWORD, insecure=INSECURE) def get_serverid(hosts, ip): for host in hosts: if ip == host.get_address(): return host.get_id() # No matching Server found raise server_id = get_serverid(api.hosts.list(), BRICK_SERVER) volume = api.clusters.get(CLUSTER_NAME).glustervolumes.get(VOLNAME) # List bricks for brick in volume.bricks.list(): print brick.get_name() # Add a Brick brick = params.GlusterBrick(brick_dir=BRICK_DIR, server_id=server_id) brick_params = params.GlusterBricks() brick_params.add_brick(brick) volume.bricks.add(brick_params) # List bricks again for brick in volume.bricks.list(): print brick.get_name() # ---------------------------------------------------------------------------- verified fix in rhsc-cb11 Please review the edited DocText and signoff. This issue was seen when bricks was added using python-sdk. So you can modify the Doc_text as follows: Previously, adding bricks using python-sdk was successful, but an error message was displayed. Now, the error message is not displayed. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHEA-2014-0208.html |
Description of problem: python call to add() successfully adds a brick to volume for ClusterGlusterVolumeBricks broker but throws an exception. Root Cause: at line 604, where assignment of result to self.__getProxy().add() occurs, self.__getProxy().add() returns empty string. <TRACE> File "/usr/lib/python2.6/site-packages/ovirtsdk/infrastructure/brokers.py", line 618, in add self.context File "/usr/lib/python2.6/site-packages/ovirtsdk/infrastructure/brokers.py", line 373, in __init__ Base.__init__(self, context) File "/usr/lib/python2.6/site-packages/ovirtsdk/infrastructure/common.py", line 24, in __init__ self.__context = context File "/usr/lib/python2.6/site-packages/ovirtsdk/xml/params.py", line 303, in __setattr__ object.__setattr__(self.superclass, item, value) AttributeError: 'str' object has no attribute '_Base__context' </TRACE> Version-Release number of selected component (if applicable): rhsc-cb3 How reproducible: 100% of the time Steps to Reproduce: 1. create a distributed volume 2. <volume param instance>.bricks.add(<bricks>) Actual results: brick successfully added but throws an exception AttributeError: 'str' object has no attribute '_Base__context' Expected results: exception is not thrown and ClusterGlusterVolumeBrick broker is returned. Additional info: