Merge lp://staging/~chad.smith/landscape-client/swift-device-monitoring into lp://staging/~landscape/landscape-client/trunk
Status: | Merged |
---|---|
Approved by: | Chad Smith |
Approved revision: | 624 |
Merged at revision: | 616 |
Proposed branch: | lp://staging/~chad.smith/landscape-client/swift-device-monitoring |
Merge into: | lp://staging/~landscape/landscape-client/trunk |
Diff against target: |
629 lines (+583/-3) 4 files modified
landscape/message_schemas.py (+6/-2) landscape/monitor/config.py (+1/-1) landscape/monitor/swiftdeviceinfo.py (+181/-0) landscape/monitor/tests/test_swiftdeviceinfo.py (+395/-0) |
To merge this branch: | bzr merge lp://staging/~chad.smith/landscape-client/swift-device-monitoring |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alberto Donato | Approve | ||
Chris Glass (community) | Approve | ||
Jerry Seutter (community) | Approve | ||
Review via email:
|
Commit message
Add separate swift-device-info plugin as a monitor plugin which will read any available swift ring files and pull swift device information from curl to the discovered local swift-recon sevice at http://<local_
Once swift devices are discovered, send this info back to the landscape-server which will process the new swift-device-info messages.
The provider is disabled and logs entered if:
- swift config files don't exist on the server
- no local swift recon service is advertised or running
Description of the change
At long last...
This branch now separates swift-storage device awareness into a separate plugin from the MountInfo plugin. Submitted for review again because we have now separated all swift-related info into separate classes and tests and there was a bit of rework necessary to persist swift_device_info.
There is a new message introduced with the following schema defining all associated swift devices and whether or not they are actively mounted in the swift cluster.
SWIFT_DEVICE_INFO = Message(
"swift-
})
The plugin determines whether or not it needs to run by checking to see if /etc/swift/
If we determine we are running on a swift storage node, we use openstack's swift.common.Ring lib to parse a ring file to determine which service ports are active on the local node.
Then we attempt to curl against http://<local_
curl -i http://
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 194
Date: Tue, 22 Jan 2013 21:45:07 GMT
[{"device": "loop0", "avail": 3176972288, "mounted": true, "used": 33767424, "size": 3210739712}, {"device": "loop1", "avail": 2103230464, "mounted": true, "used": 33767424, "size": 2136997888}]
There are probably better ways to test this, but I run Jerry's server branch locally to ensure landscape server could process the new client 'mount-info'... 'designated-
Then you can build landscape-client; cd src/landscape-
and scp the debs to you vm instance, pointing /etc/landscape/
Jerry's branch for reference: https:/
Looks good! +1
Just minor comments:
#1:
+ if content is None:
+ return None
Maybe it's not a real case, but an empty string as content would pass this and make json.loads() fail after, it'd be safer to just use "if not content".
#2: swift_devices_ no_swift_ python_ libs_available( self):
+ def test_get_
This test assumes swift libraries are not installed on the machine.
#3:
Please call tests that exercise private methods with the test_wb_ prefix.