Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1520514
  • 博文数量: 230
  • 博客积分: 474
  • 博客等级: 下士
  • 技术积分: 1955
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-19 18:40
文章分类

全部博文(230)

文章存档

2020年(3)

2019年(3)

2018年(12)

2017年(13)

2016年(11)

2015年(55)

2014年(74)

2013年(39)

2012年(2)

2011年(18)

我的朋友

分类: 云计算

2017-04-11 09:45:57

转自:

This page describes how to setup Eclipse Dev Env for keystone project.

目录

Assumptions

OS: redhat 6.1 bit64

Libvirtd: libvirtd and libvirt client are installed ( use "virsh -c qemu:///system list" to test its availability)

development env: GCC and related header files (for install needed python modules)

mysql: server and client, with root password for mysql root account ( use "echo "show databases" | mysql -uroot -proot" to test it)

OS user to use: root

To setup Eclipse

1. Make sure there is one Java available: java -version.

2. Download Eclipse

We preferably download Eclipse IDE for Java EE Developers. Please choose the proper platform version according to the OS used. Unzip it into a dir, for example /root/eclipse.

3. Prepare

After start the Eclipse, we install pydev with p2 site http://pydev.org/updates. To install it, just call out Eclipse's "install" dialogue by menu "help->install new software...".

With installed, we need to configure preference. call out preference dialogue by menu "window->preferences":

PydevPreferences.png

4. Install EGIT

Install EGIT plugins into Eclipse with site .

Play with Keystone

Clone the client GIT repo

Switch to "Git repository exploring" perspective and clone the keystoneclient Git repo "":

Gitkeystone.png

We can see where it is cloned on local directory:

Gitclientdir.png

Just shown by above figure, the code is under "/root/test/git/python-keystoneclient".

Install Keystoneclient

Keystoneclient will be installed on OS since in general we are not interested to have it in Eclipse.

On a console, run:

pip install -r tools/pip-require 
is used to install pre-requisites.

Clone keystone GIT repo

Clone keystone GIT repo site "".

Import it into Eclipse workspace

We will put keystone into Eclipse workspace and then start it there.

Right click on "working directory" and then choose "import project..." to import keystone into Eclipse workspace as "general project" since there is no project metadata in GIT:

Keystone.png

Set keystone project as project

Switch to perspective and set keystone project as project:

Pydevkeystone.png

Call out project's properties dialogue by right context menu properties to set project's PYTHONPATH:

Keystonepythonpath.png

Configure keystone and setup db

  • a) Use mysql database
  • b) setup keystone db

Run shell scripts below to create keystone db:


And Run the shell below to create tables for keystone:

Play with keystone

  • a) Set up a debug configuration for keystone in Eclipse

Keystonedebugconfigure.png


  • b) Setup debug configuration

Keystoneworkdir.png


  • c) Launch keystone

To run we can click "Debug" button on "Debug Configuration" dialogue or run it from "Debug/Run" pull down tool bar button:

Runningkeystone.png


  • d) Initialize keystone with keystone client

Run the following scripts to do the initializing to populate the first user "admin" with password "password":

To check, we can run keystone client:

阅读(1429) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~