Wednesday, July 1, 2015

oepnstack swift client debug environment setup

1: install swift proxy on a node named swift
    install swift account,container and object server on a node named swift-node

2: clone swift client repo
https://review.openstack.org/p/openstack/python-swiftclient.git

3: create a virtual env
$cd ~$SWIFT_CLIENT_HOME && virtalenv .venv
$. ./.venv/bin/activate

4: pip install -r requirements.txt   test-requirements.txt

5:Run swift client from command line
   $export export PYTHONPATH=$PYTHONPATH:.
   $$SWIFT_HOME/bin/swift --auth-version 3 list

6:Run swift client from IDE
  
   Pycharm setup

  • set project interpreter as $SWIFT_CLIENT_HOME/.venv/
  • import swift client source code into pycharm project
  • Run/edit Configuration/

  • keystone environment setup
      


Note:

  • --auth-version(-V) has to be appended to swift client otherwise it'll use v1 default  or set OS_AUTH_VERSION in openrc
  • swift-node and swift ip and host name entries should be appended to /etc/hosts on swift client node

check the serializing data structure of object.builder,account.builder and container.builder in the builder file using pickle
$ python
>>>
>>> import pickle

>>> print pickle.load(open('object.builder'))

No comments:

Post a Comment