Custom Search

Friday, February 28, 2014

How to install and configure Winff video converter in ubuntu

#sudo apt-get install winff
#sudo sudo apt-get install libavcodec-extra-53


Convert to : MPEG-4
Preset : MPEG-4 H.264 video (High Quality)

Thursday, February 27, 2014

OpenStack Tempest CLI Test Issue Fixed

Fix
===
#sudo vim /etc/tempest/tempest.conf
[identity]
uri=http://127.0.0.1:5000/v2.0/
admin_password=openstack


Error
=====
(.venv)saju@saju-Inspiron-5521:~/tempest_test/tempest$ nosetests -vx tempest.cli.simple_read_only.test_glance
tempest.cli.simple_read_only.test_glance.SimpleReadOnlyGlanceClientTest.test_glance_fake_action ... 2014-02-27 01:20:08.463 13671 INFO tempest.cli [-] running: '/usr/local/bin/glance --os-username admin --os-tenant-name admin --os-password pass --os-auth-url http://127.0.0.1:5000/v2.0/   this-does-not-exist '
ok
tempest.cli.simple_read_only.test_glance.SimpleReadOnlyGlanceClientTest.test_glance_help ... 2014-02-27 01:20:08.710 13671 INFO tempest.cli [-] running: '/usr/local/bin/glance --os-username admin --os-tenant-name admin --os-password pass --os-auth-url http://127.0.0.1:5000/v2.0/   help '
ok
tempest.cli.simple_read_only.test_glance.SimpleReadOnlyGlanceClientTest.test_glance_image_list ... 2014-02-27 01:20:08.962 13671 INFO tempest.cli [-] running: '/usr/local/bin/glance --os-username admin --os-tenant-name admin --os-password pass --os-auth-url http://127.0.0.1:5000/v2.0/   image-list '
ERROR

======================================================================
ERROR: tempest.cli.simple_read_only.test_glance.SimpleReadOnlyGlanceClientTest.test_glance_image_list
----------------------------------------------------------------------
_StringException: pythonlogging:'': {{{2014-02-27 01:20:08,962 running: '/usr/local/bin/glance --os-username admin --os-tenant-name admin --os-password pass --os-auth-url http://127.0.0.1:5000/v2.0/   image-list '}}}

Traceback (most recent call last):
  File "/home/saju/tempest_test/tempest/tempest/cli/simple_read_only/test_glance.py", line 42, in test_glance_image_list
    out = self.glance('image-list')
  File "/home/saju/tempest_test/tempest/tempest/cli/__init__.py", line 81, in glance
    'glance', action, flags, params, admin, fail_ok)
  File "/home/saju/tempest_test/tempest/tempest/cli/__init__.py", line 104, in cmd_with_auth
    return self.cmd(cmd, action, flags, params, fail_ok)
  File "/home/saju/tempest_test/tempest/tempest/cli/__init__.py", line 125, in cmd
    result)
CommandFailed: Command '['/usr/local/bin/glance', '--os-username', 'admin', '--os-tenant-name', 'admin', '--os-password', 'pass', '--os-auth-url', 'http://127.0.0.1:5000/v2.0/', 'image-list']' returned non-zero exit status 1

-------------------- >> begin captured logging << --------------------
tempest.cli: INFO: running: '/usr/local/bin/glance --os-username admin --os-tenant-name admin --os-password pass --os-auth-url http://127.0.0.1:5000/v2.0/   image-list '
--------------------- >> end captured logging << ---------------------

----------------------------------------------------------------------
Ran 3 tests in 0.881s

FAILED (errors=1)


Wednesday, February 26, 2014

OpenStack Horizon How to find and use urls of dashboard components

1)
How to find Url name for /project or http://127.0.0.1:8000/project


a)
openstack_dashboard/dashboards/project/overview/urls.py

urlpatterns = patterns('openstack_dashboard.dashboards.project.overview.views',
    url(r'^$', views.ProjectOverview.as_view(), name='index'),
    url(r'^warning$', views.WarningView.as_view(), name='warning'),
)

In the above example url(r'^$', views.ProjectOverview.as_view(), name='index') point you to http://127.0.0.1:8000/project

b)
How to use above url name in python and html files
In python
-------------------

from django.core.urlresolvers import reverse_lazy
LOGIN_REDIRECT_URL = reverse_lazy('horizon:project:overview:index')


In Html
---------------

{%url 'horizon:project:overview:index' %}


Tuesday, February 25, 2014

How to Python pip install fast install from local archives

Fast & Local Installs

Often, you will want a fast install from local archives, without probing PyPI.

First, download the archives that fulfill your requirements:

$ pip install --download -r requirements.txt


Then, install using –find-links and –no-index:

$ pip install --no-index --find-links=[file://] -r requirements.txt


http://www.pip-installer.org/en/latest/user_guide.html#fast-local-installs



cryptography distutils.errors.DistutilsError: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Solution/Fix
=============
#sudo apt-get install libffi-dev


Error
===========

Downloading/unpacking testscenarios (from python-subunit->-r /home/saju/tempest_test/tempest/test-requirements.txt (line 5))
  Downloading testscenarios-0.4.tar.gz
  Running setup.py (path:/home/saju/tempest_test/tempest/.venv/build/testscenarios/setup.py) egg_info for package testscenarios
   
Downloading/unpacking cryptography>=0.2.1 (from pyOpenSSL->python-glanceclient>=0.9.0->-r /home/saju/tempest_test/tempest/requirements.txt (line 11))
  Downloading cryptography-0.2.1.tar.gz (13.8MB): 13.8MB downloaded
  Running setup.py (path:/home/saju/tempest_test/tempest/.venv/build/cryptography/setup.py) egg_info for package cryptography
    no previously-included directories found matching 'documentation/_build'
    zip_safe flag not set; analyzing archive contents...
    six: module references __file__
   
    Installed /home/saju/tempest_test/tempest/.venv/build/cryptography/six-1.5.2-py2.7.egg
    Searching for cffi>=0.8
    Reading https://pypi.python.org/simple/cffi/
    Best match: cffi 0.8.1
    Downloading https://pypi.python.org/packages/source/c/cffi/cffi-0.8.1.tar.gz#md5=1a877bf113bfe90fdefedbf9e39310d2
    Processing cffi-0.8.1.tar.gz
    Writing /tmp/easy_install-IP8sy3/cffi-0.8.1/setup.cfg
    Running cffi-0.8.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-IP8sy3/cffi-0.8.1/egg-dist-tmp-KXIMky
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    cc -c c/check__thread.c -o c/check__thread.o
    c/_cffi_backend.c:14:17: fatal error: ffi.h: No such file or directory
     #include
                     ^
    compilation terminated.
    Traceback (most recent call last):
      File "", line 17, in
      File "/home/saju/tempest_test/tempest/.venv/build/cryptography/setup.py", line 113, in
        "build": cffi_build,
      File "/usr/lib/python2.7/distutils/core.py", line 112, in setup
        _setup_distribution = dist = klass(attrs)
      File "/home/saju/tempest_test/tempest/.venv/local/lib/python2.7/site-packages/setuptools/dist.py", line 239, in __init__
        self.fetch_build_eggs(attrs.pop('setup_requires'))
      File "/home/saju/tempest_test/tempest/.venv/local/lib/python2.7/site-packages/setuptools/dist.py", line 264, in fetch_build_eggs
        replace_conflicting=True
      File "/home/saju/tempest_test/tempest/.venv/local/lib/python2.7/site-packages/pkg_resources.py", line 580, in resolve
        dist = best[req.key] = env.best_match(req, ws, installer)
      File "/home/saju/tempest_test/tempest/.venv/local/lib/python2.7/site-packages/pkg_resources.py", line 818, in best_match
        return self.obtain(req, installer) # try and download/install
      File "/home/saju/tempest_test/tempest/.venv/local/lib/python2.7/site-packages/pkg_resources.py", line 830, in obtain
        return installer(requirement)
      File "/home/saju/tempest_test/tempest/.venv/local/lib/python2.7/site-packages/setuptools/dist.py", line 314, in fetch_build_egg
        return cmd.easy_install(req)
      File "/home/saju/tempest_test/tempest/.venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 593, in easy_install
        return self.install_item(spec, dist.location, tmpdir, deps)
      File "/home/saju/tempest_test/tempest/.venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 623, in install_item
        dists = self.install_eggs(spec, download, tmpdir)
      File "/home/saju/tempest_test/tempest/.venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 809, in install_eggs
        return self.build_and_install(setup_script, setup_base)
      File "/home/saju/tempest_test/tempest/.venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1015, in build_and_install
        self.run_setup(setup_script, setup_base, args)
      File "/home/saju/tempest_test/tempest/.venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1003, in run_setup
        raise DistutilsError("Setup script exited with %s" % (v.args[0],))
    distutils.errors.DistutilsError: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    Complete output from command python setup.py egg_info:
    no previously-included directories found matching 'documentation/_build'

zip_safe flag not set; analyzing archive contents...

six: module references __file__



Installed /home/saju/tempest_test/tempest/.venv/build/cryptography/six-1.5.2-py2.7.egg

Searching for cffi>=0.8

Reading https://pypi.python.org/simple/cffi/

Best match: cffi 0.8.1

Downloading https://pypi.python.org/packages/source/c/cffi/cffi-0.8.1.tar.gz#md5=1a877bf113bfe90fdefedbf9e39310d2

Processing cffi-0.8.1.tar.gz

Writing /tmp/easy_install-IP8sy3/cffi-0.8.1/setup.cfg

Running cffi-0.8.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-IP8sy3/cffi-0.8.1/egg-dist-tmp-KXIMky

Package libffi was not found in the pkg-config search path.

Perhaps you should add the directory containing `libffi.pc'

to the PKG_CONFIG_PATH environment variable

No package 'libffi' found

Package libffi was not found in the pkg-config search path.

Perhaps you should add the directory containing `libffi.pc'

to the PKG_CONFIG_PATH environment variable

No package 'libffi' found

Package libffi was not found in the pkg-config search path.

Perhaps you should add the directory containing `libffi.pc'

to the PKG_CONFIG_PATH environment variable

No package 'libffi' found

Package libffi was not found in the pkg-config search path.

Perhaps you should add the directory containing `libffi.pc'

to the PKG_CONFIG_PATH environment variable

No package 'libffi' found

Package libffi was not found in the pkg-config search path.

Perhaps you should add the directory containing `libffi.pc'

to the PKG_CONFIG_PATH environment variable

No package 'libffi' found

cc -c c/check__thread.c -o c/check__thread.o

c/_cffi_backend.c:14:17: fatal error: ffi.h: No such file or directory

 #include

                 ^

compilation terminated.

Traceback (most recent call last):

  File "", line 17, in

  File "/home/saju/tempest_test/tempest/.venv/build/cryptography/setup.py", line 113, in

    "build": cffi_build,

  File "/usr/lib/python2.7/distutils/core.py", line 112, in setup

    _setup_distribution = dist = klass(attrs)

  File "/home/saju/tempest_test/tempest/.venv/local/lib/python2.7/site-packages/setuptools/dist.py", line 239, in __init__

    self.fetch_build_eggs(attrs.pop('setup_requires'))

  File "/home/saju/tempest_test/tempest/.venv/local/lib/python2.7/site-packages/setuptools/dist.py", line 264, in fetch_build_eggs

    replace_conflicting=True

  File "/home/saju/tempest_test/tempest/.venv/local/lib/python2.7/site-packages/pkg_resources.py", line 580, in resolve

    dist = best[req.key] = env.best_match(req, ws, installer)

  File "/home/saju/tempest_test/tempest/.venv/local/lib/python2.7/site-packages/pkg_resources.py", line 818, in best_match

    return self.obtain(req, installer) # try and download/install

  File "/home/saju/tempest_test/tempest/.venv/local/lib/python2.7/site-packages/pkg_resources.py", line 830, in obtain

    return installer(requirement)

  File "/home/saju/tempest_test/tempest/.venv/local/lib/python2.7/site-packages/setuptools/dist.py", line 314, in fetch_build_egg

    return cmd.easy_install(req)

  File "/home/saju/tempest_test/tempest/.venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 593, in easy_install

    return self.install_item(spec, dist.location, tmpdir, deps)

  File "/home/saju/tempest_test/tempest/.venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 623, in install_item

    dists = self.install_eggs(spec, download, tmpdir)

  File "/home/saju/tempest_test/tempest/.venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 809, in install_eggs

    return self.build_and_install(setup_script, setup_base)

  File "/home/saju/tempest_test/tempest/.venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1015, in build_and_install

    self.run_setup(setup_script, setup_base, args)

  File "/home/saju/tempest_test/tempest/.venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1003, in run_setup

    raise DistutilsError("Setup script exited with %s" % (v.args[0],))

distutils.errors.DistutilsError: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /home/saju/tempest_test/tempest/.venv/build/cryptography
Storing debug log for failure in /home/saju/.pip/pip.log
Command "tools/with_venv.sh pip install --upgrade -r /home/saju/tempest_test/tempest/requirements.txt -r /home/saju/tempest_test/tempest/test-requirements.txt" failed.
None
Traceback (most recent call last):
  File "tools/colorizer.py", line 46, in
    import subunit
ImportError: No module named subunit
/home/saju/tempest_test/tempest/.venv/bin/python: No module named subunit
Non-zero exit code (1) from test listing. stdout='', stderr=None
Running flake8 ...
tools/with_venv.sh: line 4: flake8: command not found

OpenStack Tempest testr Error Fixed

1)
(.venv)saju@saju-Inspiron-5521:~/tempest_test/tempest$ testr run --parallel tempest.api.image.v2.test_images
running=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-500} \
${PYTHON:-python} -m subunit.run discover -t ./ ./tempest --list
/home/saju/tempest_test/tempest/.venv/bin/python: No module named subunit
Non-zero exit code (1) from test listing. stdout='', stderr=None


2)
(.venv)saju@saju-Inspiron-5521:~/tempest_test/tempest$ testr run --parallel tempest.api.identity.admin.v3.test_users
running=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-500} \
${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./tempest/test_discover} --list
Non-zero exit code (2) from test listing. stdout='\xb3 `q\x80\x17text/plain;charset=utf8\rimport errorsqOtempest.api.baremetal.test_api_discovery\ntempest.api.baremetal.test_chassis\ntempest.api.baremetal.test_nodes\ntempest.api.baremetal.test_ports\ntempest.api.baremetal.test_ports_negative\ntempest.api.compute.admin.test_aggregates\ntempest.api.compute.admin.test_aggregates_negative\ntempest.api.compute.admin.test_availability_zone\ntempest.api.compute.admin.test_availability_zone_negative\ntempest.api.compute.admin.test_fixed_ips\ntempest.api.compute.admin.test_fixed_ips_negative\ntempest.api.compute.admin.test_flavors\ntempest.api.compute.admin.test_flavors_access\ntempest.api.compute.admin.test_flavors_access_negative\ntempest.api.compute.admin.test_flavors_extra_specs\ntempest.api.compute.admin.test_flavors_extra_specs_negative\ntempest.api.compute.admin.test_flavors_negative\ntempest.api.compute.admin.test_hosts\ntempest.api.compute.admin.test_hosts_negative\ntempest.api.compute.admin.test_hypervisor\ntempest.api.compute.admin.test_hypervisor_negative\ntempest.api.compute.admin.test_instance_usage_audit_log\ntempest.api.compute.admin.test_instance_usage_audit_log_negative\ntempest.api.compute.admin.test_quotas\ntempest.api.compute.admin.test_quotas_negative\ntempest.api.compute.admin.test_security_groups\ntempest.api.compute.admin.test_servers\ntempest.api.compute.admin.test_servers_negative\ntempest.api.compute.admin.test_services\ntempest.api.compute.admin.test_services_negative\ntempest.api.compute.admin.test_simple_tenant_usage\ntempest.api.compute.admin.test_simple_tenant_usage_negative\ntempest.api.compute.certificates.test_certificates\ntempest.api.compute.flavors.test_flavors\ntempest.api.compute.flavors.test_flavors_negative\ntempest.api.compute.flavors.test_flavors_negative_xml\ntempest.api.compute.floating_ips.test_floating_ips_actions\ntempest.api.compute.floating_ips.test_floating_ips_actions_negative\ntempest.api.compute.floating_ips.test_list_floating_ips\ntempest.api.compute.floating_ips.test_list_floating_ips_negative\ntempest.api.compute.images.test_image_metadata\ntempest.api.compute.images.test_image_metadata_negative\ntempest.api.compute.images.test_images\ntempest.api.compute.images.test_images_oneserver\ntempest.api.compute.images.test_images_oneserver_negative\ntempest.api.compute.images.test_list_image_filters\ntempest.api.compute.images.test_list_image_filters_negative\ntempest.api.compute.images.test_list_images\ntempest.api.compute.keypairs.test_keypairs\ntempest.api.compute.keypairs.test_keypairs_negative\ntempest.api.compute.limits.test_absolute_limits\ntempest.api.compute.limits.test_absolute_limits_negative\ntempest.api.compute.security_groups.test_security_group_rules\ntempest.api.compute.security_groups.test_security_group_rules_negative\ntempest.api.compute.security_groups.test_security_groups\ntempest.api.compute.security_groups.test_security_groups_negative\ntempest.api.compute.servers.test_attach_interfaces\ntempest.api.compute.servers.test_availability_zone\ntempest.api.compute.servers.test_create_server\ntempest.api.compute.servers.test_delete_server\ntempest.api.compute.servers.test_disk_config\ntempest.api.compute.servers.test_instance_actions\ntempest.api.compute.servers.test_instance_actions_negative\ntempest.api.compute.servers.test_list_server_filters\ntempest.api.compute.servers.test_list_servers_negative\ntempest.api.compute.servers.test_multiple_create\ntempest.api.compute.servers.test_multiple_create_negative\ntempest.api.compute.servers.test_server_actions\ntempest.api.compute.servers.test_server_addresses\ntempest.api.compute.servers.test_server_addresses_negative\ntempest.api.compute.servers.test_server_metadata\ntempest.api.compute.servers.test_server_metadata_negative\ntempest.api.compute.servers.test_server_password\ntempest.api.compute.servers.test_server_personality\ntempest.api.compute.servers.test_server_rescue\ntempest.api.compute.servers.test_servers\ntempest.api.compute.servers.test_servers_negative\ntempest.api.compute.servers.test_servers_negative_new\ntempest.api.compute.servers.test_virtual_interfaces\ntempest.api.compute.servers.test_virtual_interfaces_negative\ntempest.api.compute.test_authorization\ntempest.api.compute.test_extensions\ntempest.api.compute.test_live_block_migration\ntempest.api.compute.test_live_block_migration_negative\ntempest.api.compute.test_quotas\ntempest.api.compute.v3.admin.test_aggregates\ntempest.api.compute.v3.admin.test_aggregates_negative\ntempest.api.compute.v3.admin.test_availability_zone\ntempest.api.compute.v3.admin.test_availability_zone_negative\ntempest.api.compute.v3.admin.test_flavors\ntempest.api.compute.v3.admin.test_flavors_access\ntempest.api.compute.v3.admin.test_flavors_access_negative\ntempest.api.compute.v3.admin.test_flavors_extra_specs\ntempest.api.compute.v3.admin.test_flavors_extra_specs_negative\ntempest.api.compute.v3.admin.test_flavors_negative\ntempest.api.compute.v3.admin.test_hosts\ntempest.api.compute.v3.admin.test_hosts_negative\ntempest.api.compute.v3.admin.test_hypervisor\ntempest.api.compute.v3.admin.test_hypervisor_negative\ntempest.api.compute.v3.admin.test_quotas\ntempest.api.compute.v3.admin.test_servers\ntempest.api.compute.v3.admin.test_servers_negative\ntempest.api.compute.v3.admin.test_services\ntempest.api.compute.v3.admin.test_services_negative\ntempest.api.compute.v3.certificates.test_certificates\ntempest.api.compute.v3.flavors.test_flavors\ntempest.api.compute.v3.flavors.test_flavors_negative\ntempest.api.compute.v3.images.test_images\ntempest.api.compute.v3.images.test_images_oneserver\ntempest.api.compute.v3.images.test_images_oneserver_negative\ntempest.api.compute.v3.keypairs.test_keypairs\ntempest.api.compute.v3.keypairs.test_keypairs_negative\ntempest.api.compute.v3.servers.test_attach_interfaces\ntempest.api.compute.v3.servers.test_attach_volume\ntempest.api.compute.v3.servers.test_availability_zone\ntempest.api.compute.v3.servers.test_create_server\ntempest.api.compute.v3.servers.test_delete_server\ntempest.api.compute.v3.servers.test_instance_actions\ntempest.api.compute.v3.servers.test_list_server_filters\ntempest.api.compute.v3.servers.test_list_servers_negative\ntempest.api.compute.v3.servers.test_multiple_create\ntempest.api.compute.v3.servers.test_server_actions\ntempest.api.compute.v3.servers.test_server_addresses\ntempest.api.compute.v3.servers.test_server_metadata\ntempest.api.compute.v3.servers.test_server_metadata_negative\ntempest.api.compute.v3.servers.test_server_password\ntempest.api.compute.v3.servers.test_server_rescue\ntempest.api.compute.v3.servers.test_servers\ntempest.api.compute.v3.servers.test_servers_negative\ntempest.api.compute.v3.test_extensions\ntempest.api.compute.v3.test_live_block_migration\ntempest.api.compute.v3.test_live_block_migration_negative\ntempest.api.compute.v3.test_quotas\ntempest.api.compute.v3.test_version\ntempest.api.compute.volumes.test_attach_volume\ntempest.api.compute.volumes.test_volumes_get\ntempest.api.compute.volumes.test_volumes_list\ntempest.api.compute.volumes.test_volumes_negative\ntempest.api.data_processing.test_node_group_templates\ntempest.api.data_processing.test_plugins\ntempest.api.identity.admin.test_roles\ntempest.api.identity.admin.test_roles_negative\ntempest.api.identity.admin.test_services\ntempest.api.identity.admin.test_tenant_negative\ntempest.api.identity.admin.test_tenants\ntempest.api.identity.admin.test_tokens\ntempest.api.identity.admin.test_users\ntempest.api.identity.admin.test_users_negative\ntempest.api.identity.admin.v3.test_credentials\ntempest.api.identity.admin.v3.test_domains\ntempest.api.identity.admin.v3.test_endpoints\ntempest.api.identity.admin.v3.test_groups\ntempest.api.identity.admin.v3.test_policies\ntempest.api.identity.admin.v3.test_projects\ntempest.api.identity.admin.v3.test_roles\ntempest.api.identity.admin.v3.test_services\ntempest.api.identity.admin.v3.test_tokens\ntempest.api.identity.admin.v3.test_trusts\ntempest.api.identity.admin.v3.test_users\ntempest.api.image.v1.test_image_members\ntempest.api.image.v1.test_image_members_negative\ntempest.api.image.v1.test_images\ntempest.api.image.v1.test_images_negative\ntempest.api.image.v2.test_images\ntempest.api.image.v2.test_images_member\ntempest.api.image.v2.test_images_member_negative\ntempest.api.image.v2.test_images_negative\ntempest.api.image.v2.test_images_tags\ntempest.api.image.v2.test_images_tags_negative\ntempest.api.network.admin.test_agent_management\ntempest.api.network.admin.test_dhcp_agent_scheduler\ntempest.api.network.admin.test_l3_agent_scheduler\ntempest.api.network.admin.test_lbaas_agent_scheduler\ntempest.api.network.test_extensions\ntempest.api.network.test_extra_dhcp_options\ntempest.api.network.test_floating_ips\ntempest.api.network.test_load_balancer\ntempest.api.network.test_metering_extensions\ntempest.api.network.test_networks\ntempest.api.network.test_networks_negative\ntempest.api.network.test_quotas\ntempest.api.network.test_routers\ntempest.api.network.test_routers_negative\ntempest.api.network.test_security_groups\ntempest.api.network.test_security_groups_negative\ntempest.api.network.test_service_type_management\ntempest.api.network.test_vpnaas_extensions\ntempest.api.object_storage.test_account_bulk\ntempest.api.object_storage.test_account_quotas\ntempest.api.object_storage.test_account_quotas_negative\ntempest.api.object_storage.test_account_services\ntempest.api.object_storage.test_account_services_negative\ntempest.api.object_storage.test_container_acl\ntempest.api.object_storage.test_container_acl_negative\ntempest.api.object_storage.test_container_quotas\ntempest.api.object_storage.test_container_services\ntempest.api.object_storage.test_container_staticweb\ntempest.api.object_storage.test_container_sync\ntempest.api.object_storage.test_crossdomain\ntempest.api.object_storage.test_healthcheck\ntempest.api.object_storage.test_object_expiry\ntempest.api.object_storage.test_object_formpost\ntempest.api.object_storage.test_object_formpost_negative\ntempest.api.object_storage.test_object_services\ntempest.api.object_storage.test_object_slo\ntempest.api.object_storage.test_object_temp_url\ntempest.api.object_storage.test_object_temp_url_negative\ntempest.api.object_storage.test_object_version\ntempest.api.orchestration.stacks.test_limits\ntempest.api.orchestration.stacks.test_neutron_resources\ntempest.api.orchestration.stacks.test_non_empty_stack\ntempest.api.orchestration.stacks.test_server_cfn_init\ntempest.api.orchestration.stacks.test_stacks\ntempest.api.orchestration.stacks.test_templates\ntempest.api.orchestration.stacks.test_templates_negative\ntempest.api.telemetry.test_telemetry_alarming_api\ntempest.api.volume.admin.test_multi_backend\ntempest.api.volume.admin.test_snapshots_actions\ntempest.api.volume.admin.test_volume_hosts\ntempest.api.volume.admin.test_volume_types\ntempest.api.volume.admin.test_volume_types_extra_specs\ntempest.api.volume.admin.test_volume_types_extra_specs_negative\ntempest.api.volume.admin.test_volume_types_negative\ntempest.api.volume.admin.test_volumes_actions\ntempest.api.volume.admin.test_volumes_backup\ntempest.api.volume.test_extensions\ntempest.api.volume.test_snapshot_metadata\ntempest.api.volume.test_volume_metadata\ntempest.api.volume.test_volume_transfers\ntempest.api.volume.test_volumes_actions\ntempest.api.volume.test_volumes_get\ntempest.api.volume.test_volumes_list\ntempest.api.volume.test_volumes_negative\ntempest.api.volume.test_volumes_snapshots\ntempest.api.volume.test_volumes_snapshots_negative\ntempest.api.volume.v2.test_volumes_list\ntempest.cli.simple_read_only.test_ceilometer\ntempest.cli.simple_read_only.test_cinder\ntempest.cli.simple_read_only.test_glance\ntempest.cli.simple_read_only.test_heat\ntempest.cli.simple_read_only.test_keystone\ntempest.cli.simple_read_only.test_neutron\ntempest.cli.simple_read_only.test_nova\ntempest.cli.simple_read_only.test_nova_manage\ntempest.cli.simple_read_only.test_savanna\ntempest.scenario.orchestration.test_autoscaling\ntempest.scenario.test_aggregates_basic_ops\ntempest.scenario.test_dashboard_basic_ops\ntempest.scenario.test_large_ops\ntempest.scenario.test_load_balancer_basic\ntempest.scenario.test_minimum_basic\ntempest.scenario.test_network_basic_ops\ntempest.scenario.test_security_groups_basic_ops\ntempest.scenario.test_server_advanced_ops\ntempest.scenario.test_server_basic_ops\ntempest.scenario.test_snapshot_pattern\ntempest.scenario.test_stamp_pattern\ntempest.scenario.test_swift_basic_ops\ntempest.scenario.test_volume_boot_pattern\ntempest.thirdparty.boto.test\ntempest.thirdparty.boto.test_ec2_instance_run\ntempest.thirdparty.boto.test_ec2_keys\ntempest.thirdparty.boto.test_ec2_network\ntempest.thirdparty.boto.test_ec2_security_groups\ntempest.thirdparty.boto.test_ec2_volumes\ntempest.thirdparty.boto.test_s3_buckets\ntempest.thirdparty.boto.test_s3_ec2_images\ntempest.thirdparty.boto.test_s3_objectsI\xab\xff\x9a', stderr=None

Monday, February 24, 2014

OpenStack Tempest Can not find requested image

1)
  File "/home/saju/tempest_test/tempest/tempest/common/rest_client.py", line 486, in _error_checker
    raise exceptions.BadRequest(resp_body)
BadRequest: Bad request
Details: {u'badRequest': {u'message': u'Can not find requested image', u'code': 400}}

=============Solution/Fix================



Please use valid Image ID

#sudo vim /etc/tempest/tempest.conf
[compute]
image_ref=09e3a9eb-c786-4687-a0e8-0c44b22f5539
image_ref_alt=09e3a9eb-c786-4687-a0e8-0c44b22f5539

How to Manually Install and Configure OpenStack Tempest

1)
Install OpenStack using devstack and make it running
http://www.youtube.com/watch?v=AdrbYP7utDE

2)
#mkdir tempest_test
#cd tempest_test
#git clone https://github.com/openstack/tempest.git

#git checkout stable/branch_you_need



3)
You will get dependency errors when running following commands
#nosetests -v tempest

4)
Create virtualenv and install all dependencies
#./run_tempest.sh

5)
Activate virtualenv
#ls -a
#source .venv/bin/activate


6)
Find command help
#nosetests -v tempest --help

7)
Stop running tests after the first error or failure (use -x or --stop option)
#nosetests -vx tempest
or
#nosetests -v tempest --stop


8)

ConfigFilesNotFoundError: Failed to read some config files: /etc/tempest/tempest.conf

=============Solution/Fix================

a)
Goto
#cd tempest_test/tempest/etc
#vim tempest.conf.sample

Read "tempest.conf.sample" file and understand different config options

b)
Copy tempest.conf.sample to /etc/tempest/tempest.conf
#sudo mkdir /etc/tempest
#sudo cp tempest.conf.sample /etc/tempest/tempest.conf

How to Test OpenStack Deployment With Tempest - API Tests - Volume - Network - Object Storage

How to Manually Install OpenStack Tempest
============================
http://fosshelp.blogspot.com/2014/02/how-to-manually-install-openstack.html 


Volume API Tests
############


1)
Minimum Config

Comment all other config under the "[identity]" section and use default value for that.
#sudo vim /etc/tempest/tempest.conf
[identity]
uri=http://127.0.0.1:5000/v2.0/
password=openstack
admin_password=openstack


2)
#nosetests -vx tempest.api.volume.test_volumes_list

3)
  File "/home/saju/tempest_test/tempest/.venv/local/lib/python2.7/site-packages/oslo/config/cfg.py", line 1648, in __getattr__
    raise NoSuchOptError(name)
NoSuchOptError: no such option: IMAGE_ID


=============Solution/Fix================

#sudo vim /etc/tempest/tempest.conf
[compute]
image_ref=09e3a9eb-c786-4687-a0e8-0c44b22f5539


4)
#nosetests -vx tempest.api.volume.test_volumes_list
OR
#testr run --parallel tempest.api.volume.test_volumes_list
OR
#testr run tempest.api.volume.test_volumes_list

5)

  File "/home/saju/tempest_test/tempest/tempest/common/rest_client.py", line 192, in keystone_auth
    raise exceptions.EndpointNotFound(service)
EndpointNotFound: Endpoint not found
Details: Volume

=============Solution/Fix================

#sudo vim /etc/tempest/tempest.conf
[volume]
catalog_type=volume




Network API Tests
#############


1)
Minimum Config

Comment all other config under the "[identity]" section and use default value for that.
#sudo vim /etc/tempest/tempest.conf
[identity]
uri=http://127.0.0.1:5000/v2.0/
password=openstack
admin_password=openstack


2)
#nosetests -vx tempest.api.network.test_floating_ips

3)
SKIP: Neutron support is required
SKIP: Neutron support is required

----------------------------------------------------------------------
Ran 0 tests in 0.731s

OK (SKIP=2)

=============Solution/Fix================


Object Storage API Tests
################


1)
Minimum Config

Comment all other config under the "[identity]" section and use default value for that.
#sudo vim /etc/tempest/tempest.conf
[identity]
uri=http://127.0.0.1:5000/v2.0/
password=openstack
admin_password=openstack


2)
#nosetests -vx tempest.api.object_storage.test_container_services:ContainerTest.test_create_container
3)

  File "/home/saju/tempest_test/tempest/tempest/common/rest_client.py", line 192, in keystone_auth
    raise exceptions.EndpointNotFound(service)
EndpointNotFound: Endpoint not found
Details: object-store

=========
Note:

-vxl 
x ---> Stop running tests after the first error or failure
l ---> Run test in Debug mode: So we can see better error message

How to Test OpenStack Deployment With Tempest - Scenario Tests

How to Manually Install OpenStack Tempest
============================
http://fosshelp.blogspot.com/2014/02/how-to-manually-install-openstack.html


1)
Minimum Config

Comment all other config under the "[identity]" section and use default value for that.
#sudo vim /etc/tempest/tempest.conf
[identity]
uri=http://127.0.0.1:5000/v2.0/
password=openstack
admin_password=openstack


2)
a)
#nosetests -vx tempest.scenario.test_minimum_basic:TestMinimumBasicScenario.nova_keypair_add

b)
#nosetests -vx tempest.scenario.test_dashboard_basic_ops
#nosetests -vxl tempest.scenario.test_dashboard_basic_ops

Additional config
#sudo vim /etc/tempest/tempest.conf
[DEFAULT]
lock_path=/tmp

[compute]
image_ref=c6942e06-2ad5-4ff6-877b-1652f85d93e8
image_ref_alt=c6942e06-2ad5-4ff6-877b-1652f85d93e8

[compute-admin]
password=openstack

3)
-vxl 
x ---> Stop running tests after the first error or failure
l ---> Run test in Debug mode: So we can see better error message

How to Test OpenStack Deployment With Tempest - Stress Tests

How to Manually Install OpenStack Tempest
============================
http://fosshelp.blogspot.com/2014/02/how-to-manually-install-openstack.html 



http://docs.openstack.org/developer/tempest/field_guide/stress.html

How to Test OpenStack Deployment With Tempest - CLI Tests

How to Manually Install OpenStack Tempest
============================
http://fosshelp.blogspot.com/2014/02/how-to-manually-install-openstack.html 


1)
Minimum Config

Comment all other config under the "[identity]" section and use default value for that.
#sudo vim /etc/tempest/tempest.conf
[identity]
uri=http://127.0.0.1:5000/v2.0/
admin_password=openstack


2)
Working

#nosetests -vx tempest.cli.simple_read_only.test_glance
#nosetests -vx tempest.cli.simple_read_only.test_nova
#nosetests -vx tempest.cli.simple_read_only.test_cinder
#nosetests -vx tempest.cli.simple_read_only.test_neutron


3)
-vxl 
x ---> Stop running tests after the first error or failure
l ---> Run test in Debug mode: So we can see better error message

How to Test OpenStack Deployment With Tempest - API Tests - Identity - Image - Compute

How to Manually Install OpenStack Tempest
============================
http://fosshelp.blogspot.com/2014/02/how-to-manually-install-openstack.html


Identity API Tests
#############


1)

#nosetests -vx tempest.api.identity.admin.v3.test_users.py

2)
Minimum Config
Comment all other config under the "[identity]" section and use default value for that.
#sudo vim /etc/tempest/tempest.conf
[identity]
uri=http://127.0.0.1:5000/v2.0/
password=openstack
admin_password=openstack


3)
(Working)
a)V3

#nosetests -vx tempest.api.identity.admin.v3.test_users.py
#nosetests -vx tempest.api.identity.admin.v3.test_users:UsersV3TestJSON
#nosetests -vx tempest.api.identity.admin.v3.test_users:UsersV3TestJSON.test_list_user_projects

OR
testr run --parallel tempest.api.identity.admin.v3.test_users
testr run tempest.api.identity.admin.v3.test_users




b)V2
#nosetests -vx tempest.api.identity.admin.test_users.py
#nosetests -vx tempest.api.identity.admin.test_users:UsersTestJSON
#nosetests -vx tempest.api.identity.admin.test_users:UsersTestJSON.test_create_user


Image API Tests
###########


1)
#nosetests -vx tempest.api.identity.admin.v3.test_users.py

2)
Minimum Config
Comment all other config under the "[identity]" section and use default value for that.
#sudo vim /etc/tempest/tempest.conf
[identity]
uri=http://127.0.0.1:5000/v2.0/
password=openstack
admin_password=openstack


3)
(Working)
#nosetests -vx tempest.api.image.v2.test_images
#nosetests -vx tempest.api.image.v1.test_images

OR
#testr run --parallel tempest.api.image.v2.test_images
#testr run tempest.api.image.v2.test_images

Compute API Tests
#############


1)
Minimum Config
Comment all other config under the "[identity]" section and use default value for that.
#sudo vim /etc/tempest/tempest.conf
[identity]
uri=http://127.0.0.1:5000/v2.0/
password=openstack
admin_password=openstack


2)
#nosetests -vx tempest.api.compute.keypairs.test_keypairs

3)
  File "/home/saju/tempest_test/tempest/.venv/local/lib/python2.7/site-packages/oslo/config/cfg.py", line 1648, in __getattr__
    raise NoSuchOptError(name)
NoSuchOptError: no such option: IMAGE_ID

  File "/home/saju/tempest_test/tempest/.venv/local/lib/python2.7/site-packages/oslo/config/cfg.py", line 1648, in __getattr__
    raise NoSuchOptError(name)
NoSuchOptError: no such option: IMAGE_ID_ALT

=============Solution/Fix================



a)
Find Image_id
Goto devstack folder
#cd devstack
#source eucarc
or
#source openrc

Run following command and copy the ID.

#nova image-list
 

b)
Edit  /etc/tempest/tempest.conf
#sudo vim /etc/tempest/tempest.conf
[compute]
image_ref=09e3a9eb-c786-4687-a0e8-0c44b22f5539
image_ref_alt=09e3a9eb-c786-4687-a0e8-0c44b22f5539


4)
Working
#nosetests -vx tempest.api.compute.keypairs.test_keypairs

5)
admin
#nosetests -vx tempest.api.compute.admin.test_flavors

6)
  File "/home/saju/tempest_test/tempest/tempest/common/rest_client.py", line 199, in keystone_auth
    tenant=tenant_name)
AuthenticationFailure: Authentication with user admin and password pass failed auth using tenant admin.

=============Solution/Fix================

#sudo vim /etc/tempest/tempest.conf
[compute-admin]
password=openstack


7)
Working
admin

#nosetests -vx tempest.api.compute.admin.test_flavors
#nosetests -vx tempest.api.compute.admin.test_flavors:FlavorsAdminTestJSON
#nosetests -vx tempest.api.compute.admin.test_flavors:FlavorsAdminTestJSON.test_create_flavor


8)
Examples
#nosetests -vx tempest.api.compute.images.test_images
#testr run --parallel tempest.api.compute.images.test_images
#testr run tempest.api.compute.images.test_images


=====
Note:
-vxl 
x ---> Stop running tests after the first error or failure
l ---> Run test in Debug mode: So we can see better error message

Saturday, February 22, 2014

OpenStack Horizon You don't have permission to access / on this server.[Fixed]

1)
Edit horizon.conf
#sudo vim /etc/apache2/sites-available/horizon.conf

Please add the line "Require all granted" as per below:

   Directory />
        Options FollowSymLinks
        AllowOverride None
        Require all granted
    Directory>

2)
#sudo service apache2 restart

How to Test OpenStack Keystone or Identity Deployment With Tempest

How to Test OpenStack Keystone or Identity Deployment With Tempest

1)
Install OpenStack using devstack and make it running
http://www.youtube.com/watch?v=AdrbYP7utDE

2)
#mkdir tempest_test
#cd tempest_test
#git clone https://github.com/openstack/tempest.git

#git checkout stable/branch_you_need



3)
You will get dependency errors when running following commands
#nosetests -v tempest

4)
Create virtualenv and install all dependencies
#./run_tempest.sh

5)
Activate virtualenv
#ls -a
#source .venv/bin/activate


6)
Find command help
#nosetests -v tempest --help

7)
Stop running tests after the first error or failure (use -x or --stop option)
#nosetests -vx tempest
or
#nosetests -v tempest --stop


8)

ConfigFilesNotFoundError: Failed to read some config files: /etc/tempest/tempest.conf

=============Solution/Fix================

a)
Goto
#cd tempest_test/tempest/etc
#vim tempest.conf.sample

Read "tempest.conf.sample" file and understand different config options

b)
Copy tempest.conf.sample to /etc/tempest/tempest.conf
#sudo mkdir /etc/tempest
#sudo cp tempest.conf.sample /etc/tempest/tempest.conf


9)
Run only the tests inside the module test_users.py
#nosetests -vx tempest.api.identity.admin.v3.test_users.py

10)
File "/home/saju/tempest_test/tempest/tempest/services/identity/json/identity_client.py", line 226, in __init__
    if 'tokens' not in auth_url:
TypeError: argument of type 'NoneType' is not iterable

=============Solution/Fix================

#sudo vim /etc/tempest/tempest.conf
[identity]
uri=http://127.0.0.1:5000/v2.0/


11)
Run only the tests inside the module test_users.py
#nosetests -vx tempest.api.identity.admin.v3.test_users.py

12)
  File "/home/saju/tempest_test/tempest/tempest/services/identity/v3/json/identity_client.py", line 448, in __init__
    raise exceptions.InvalidConfiguration('you must specify a v3 uri '
InvalidConfiguration: Invalid Configuration
Details: you must specify a v3 uri if using the v3 identity api

=============Solution/Fix================

#sudo vim /etc/tempest/tempest.conf
[identity]
uri=http://127.0.0.1:5000/v2.0/
uri_v3=http://127.0.0.1:5000/v3/


13)

Run only the tests inside the module test_users.py
#nosetests -vx tempest.api.identity.admin.v3.test_users.py

14)
  File "/home/saju/tempest_test/tempest/tempest/services/identity/json/identity_client.py", line 260, in request
    raise exceptions.Unauthorized(resp_body['error']['message'])
Unauthorized: Unauthorized
Details: Invalid user / password

-------------------- >> begin captured logging << --------------------
tempest.api.identity: DEBUG: Entering tempest.api.identity.setup_package
tempest.common.rest_client: INFO: Request: POST http://127.0.0.1:5000/v2.0/tokens
tempest.common.rest_client: DEBUG: Request Headers: {'Content-Type': 'application/json', 'Accept': 'application/json'}
tempest.common.rest_client: DEBUG: Request Body: {"auth": {"tenantName": "admin", "passwordCredentials": {"username": "admin", "password": "pass"}}} <==== IMP
tempest.common.rest_client: INFO: Response Status: 401
tempest.common.rest_client: DEBUG: Response Headers: {'content-length': '87', 'date': 'Sat, 22 Feb 2014 16:47:14 GMT', 'content-type': 'application/json', 'vary': 'X-Auth-Token', 'connection': 'close'}
tempest.common.rest_client: DEBUG: Response Body: {"error": {"message": "Invalid user / password", "code": 401, "title": "Unauthorized"}}
--------------------- >> end captured logging << ---------------------

----------------------------------------------------------------------
Ran 1 test in 0.117s

FAILED (failures=1)

=============Solution/Fix================

[identity]
uri=http://127.0.0.1:5000/v2.0/
uri_v3=http://127.0.0.1:5000/v3/
admin_password=openstack

15)
(Working)

Run only the tests inside the module test_users.py
#nosetests -vx tempest.api.identity.admin.v3.test_users.py

16)
(Summary)

So, The minimum configuration to run identity tempest test

a)
#sudo vim /etc/tempest/tempest.conf
[identity]
uri=http://127.0.0.1:5000/v2.0/
uri_v3=http://127.0.0.1:5000/v3/
admin_password=openstack


OR

[identity]
uri=http://127.0.0.1:5000/v2.0/
uri_v3=http://127.0.0.1:5000/v3/
admin_username=admin

admin_tenant_name=admin
admin_password=openstack

b)
Run only the tests inside the module test_users.py
#nosetests -vx tempest.api.identity.admin.v3.test_users.py
OR
#nosetests -vx tempest.api.identity.admin.v3.test_users
OR
nosetests -vx tempest.api.identity.admin.v3.test_users.py:UsersV3TestJSON.test_list_user_projects
OR
nosetests -vx tempest.api.identity.admin.v3.test_users:UsersV3TestJSON.test_list_user_projects


======
Note:
-vxl 
x ---> Stop running tests after the first error or failure
l ---> Run test in Debug mode: So we can see better error message

OpenSatck Horizon How to Run Selenium Unit Tests

1)
Goto horizon folder
eg: cd /opt/stack/horizon



2)
./run_tests.sh --only-selenium
OR
./run_tests.sh --with-selenium

--only-selenium  ==>  Run only the Selenium unit tests
--with-selenium  ==>  Run unit tests including Selenium tests

Friday, February 21, 2014

OpenStack Horizon LockFailed: failed to create /opt/stack/horizon/openstack_dashboard/local/demo.MainThread-9602

1)
Goto /opt/stack
#cd /opt/stack

2)
Check th eownser ship of all folders
#ls -l
drwxr-xr-x 10 saju saju     4096 Feb 17 12:47 cinder
drwxr-xr-x  6 saju saju      4096 Feb 17 12:48 data
drwxr-xr-x  8 saju saju     4096 Feb 17 12:47 glance
drwxr-xr-x 12 root root     4096 Feb 21 08:02 horizon <====

3)
Note: ownership of horizon is "root" since i copied that folder with "sudo".
Change ownership of horizon to "saju".
#chown -R saju:saju horizon

4)
Restart apache
#sudo service apache2 restart

Thursday, February 20, 2014

GNOME Terminal How to Open new tab with working directory Ubuntu

1)
Open  ~/.bashrc and add following lines
#vim ~/.bashrc
[[ -s "/etc/profile.d/vte.sh" ]] && . "/etc/profile.d/vte.sh"



2)
Close all GNOME Terminals, Then Open and Test. :)

Monday, February 17, 2014

How to install python packages in virtualenv using sudo

How to install python packages in virtualenv using sudo

Issue
=====

a)
I created a virtualenv ".venv" using following command in /opt
#cd /opt
#sudo virtualenv .venv
#source .venv/bin/activate
#sudo easy_install python-keystoneclient

But package not installing in virtualenv ".venv" instead it pointing to
/usr/local/lib/python2.7/dist-packages/python_keystoneclient-0.6.0.2.g43f8870-py2.7.egg

b)
(.venv2)saju@rildemo2:/opt/horizon_reg_service$ sudo easy_install python-keystoneclient
Searching for python-keystoneclient
Best match: python-keystoneclient 0.6.0.2.g43f8870
Processing python_keystoneclient-0.6.0.2.g43f8870-py2.7.egg
python-keystoneclient 0.6.0.2.g43f8870 is already the active version in easy-install.pth
Installing keystone script to /usr/local/bin

Using /usr/local/lib/python2.7/dist-packages/python_keystoneclient-0.6.0.2.g43f8870-py2.7.egg
Processing dependencies for python-keystoneclient
Finished processing dependencies for python-keystoneclient
(.venv2)saju@rildemo2:/opt/horizon_reg_service$

Solutions
==========

1) (Tested and working)
sudo is probably screwing with $PATH. delete the virtualenv, `sudo -i` to get a root shell, then make the virtualenv without sudo (as root)
#sudo -i
#cd /opt
#virtualenv .venv
#source .venv/bin/activate
#pip install python-keystoneclient


2)
the better thing to do would be to make the /opt/.venv folder, change the ownership to your user, and then do the virtualenv stuff as your normal user (without sudo)

Saturday, February 15, 2014

OpenStack Horizon Dashboard How to customize header sidebar and stylesheet

OpenStack Horizon Dashboard How to customize header sidebar and stylesheet

A)
Existing Code
==========
1)
I could see two _header.html in Openstack Havana horizon projects

a)
horizon/openstack_dashboard/templates/_header.html
This "_header.html" contains username, Settings, Help and Signout links.

{% load i18n %}
{% load url from future %}
  {% blocktrans with username=request.user.username %}Logged in as: {{ username }}{% endblocktrans %}
  {% trans "Settings" %}
  {% if HORIZON_CONFIG.help_url %}
  {% trans "Help" %}
  {% endif %}
  {% trans "Sign Out" %}
  {% include "horizon/common/_region_selector.html" %}

b)
horizon/horizon/templates/_header.html
I don't know, where we using this "_header.html" template.

2)
horizon/horizon/templates/base.html
* The "horizon/openstack_dashboard/templates/_header.html" is included in the "base.html".
* The "horizon/horizon/templates/horizon/common/_sidebar.html" is included in the "base.html".

{% load branding i18n %}
DOCTYPE html>
html>
  head>
    meta content='text/html; charset=utf-8' http-equiv='Content-Type' />
    title>{% block title %}{% endblock %} - {% site_branding %}

    {% comment %} Load CSS sheets before Javascript  {% endcomment %}
    {% block css %}
      {% include "_stylesheets.html" %}
    {% endblock %}
    {% include "horizon/_conf.html" %}
    {% include "horizon/client_side/_script_loader.html" %}
  /head>
  body id="{% block body_id %}{% endblock %}">
    {% block content %}
      div id="container">
        {% block sidebar %}
          {% include 'horizon/common/_sidebar.html' %}
        {% endblock %}
        div id='main_content'>
          div class='topbar'>
          {% include "_header.html" %}
          {% block page_header %}{% endblock %}
          /div>
          {% include "horizon/_messages.html" %}
          {% block main %}{% endblock %}
        /div>
      /div>
    {% endblock %}
    div id="footer">
      {% block footer %}{% endblock %}
    /div>
    {% block js %}
      {% include "horizon/_scripts.html" %}
    {% endblock %}
    div id="modal_wrapper" />
  /body>
/html>

3)

B)
Customized Code
===========


1)
Create a new folder like
horizon/horizon/templates/custom_cloud/common/

2)
Copy existing "_header.html" from horizon/openstack_dashboard/templates/ to
horizon/horizon/templates/custom_cloud/common/

3)
Copy existing "_sidebar.html" from horizon/horizon/templates/horizon/common/ to
horizon/horizon/templates/custom_cloud/common/

4)
So you copied two html files to new folder
horizon/horizon/templates/custom_cloud/common/_header.html
horizon/horizon/templates/custom_cloud/common/_sidebar.html

5)
* First take a copy of horizon/horizon/templates/base.html and rename to
horizon/horizon/templates/base.html.backup.

* Then edit the original horizon/horizon/templates/base.html and update with following lines
{% include "custom_cloud/common/_sidebar.html" %}
{% include "custom_cloud/common/_header.html" %}


6)
Modify "custom_cloud/common/_sidebar.html" and "custom_cloud/common/_header.html"
based on your requirement.

7)
How to Modify CSS
http://fosshelp.blogspot.in/2014/02/openstack-horizon-how-to-include-custom.html

Friday, February 14, 2014

OpenStack Horizon How to include custom stylesheets css less

Method 1 (Tested with OpenStack Havana)
===========================

1)
Create a folder for css/less. like,
horizon/openstack_dashboard/static/custom_dashboard/less

2)
Goto that folder and create a css/less file dashboard.less
#cd horizon/openstack_dashboard/static/custom_dashboard/less
#vim dashboard.less

3)
Open _stylesheets.html file and include your stylesheet there.
horizon/openstack_dashboard/templates/_stylesheets.html

{% load compress %}

{% compress css %}
link href='{{ STATIC_URL }}dashboard/less/horizon.less' type='text/less' media='screen' rel='stylesheet' />
link href='{{ STATIC_URL }}dashboard/less/rickshaw.css' type='text/css' media='screen' rel='stylesheet' />
link href='{{ STATIC_URL }}dashboard/less/horizon_charts.less' type='text/less' media='screen' rel='stylesheet' />
link href='{{ STATIC_URL }}custom_dashboard/less/dashboard.less' type='text/less' media='screen' rel='stylesheet' />
{% endcompress %}

link rel="shortcut icon" href="{{ STATIC_URL }}dashboard/img/favicon.ico"/>

4)
Restart apache
#sudo service apache2 restart

Notes:
----------

* In horizon you can find two _stylesheets.html files
a)
horizon/openstack_dashboard/templates/_stylesheets.html
Included in horizon/horizon/templates/base.html
Here, base.html is the base of all dashboard pages.

b)
horizon/horizon/templates/_stylesheets.html
Included in horizon/horizon/templates/splash.html
Here, splash.html is the Login Page.


Method 2 (Tested with OpenStack Havana)
===========================

1)
Create a folder for css/less. like,
horizon/openstack_dashboard/static/custom_dashboard/less

2)
Goto that folder and create a css/less file dashboard.less
#cd horizon/openstack_dashboard/static/custom_dashboard/less
#vim dashboard.less

3)
a)
Goto horizon/horizon/templates
#cd horizon/horizon/templates

b)
Rename "base.html" to "horizon_base.html"

c)
Create a new html file named "base.html" and add following lines.
{% extends 'horizon_base.html' %}

{% block css %}
  {% include "_stylesheets.html" %}

  {% load compress %}
  {% compress css %}
  link href='{{ STATIC_URL }}custom_dashboard/less/dashboard.less' type='text/less' media='screen' rel='stylesheet' />
  {% endcompress %}
{% endblock %}

4)
Restart apache
#sudo service apache2 restart

Notes:
---------
a)
If you are planning to implement like following link, then you have to edit all dashboard templates
http://docs.openstack.org/developer/horizon/topics/customizing.html

b)
You can also try following method (recomended)
http://docs.openstack.org/grizzly/openstack-compute/install/yum/content/dashboard-custom-brand.html

Django local_settings.py how to add apps in INSTALLED_APPS

Django local_settings.py how to extend INSTALLED_APPS

1)
Add following lines in local_settings.py

ADDITIONAL_APPS = ('captcha', 'cities_light')try:
    from settings import INSTALLED_APPS
    INSTALLED_APPS = ADDITIONAL_APPS + INSTALLED_APPS
except:
    pass

Tuesday, February 11, 2014

Devstack How to install stable OpenStack havana in Ubuntu 13.10

1)
#cd /home/saju
#mkdir openstack
#cd openstack
#git clone https://github.com/openstack-dev/devstack.git -b stable/havana

* Here /home/saju/openstack/devstack/stackrc is already set to use stable/havana branch for all the Openstack services



2)
#cd /home/saju/openstack/devstack
#vim localrc

###./stack will ask you for the password if the "localrc" file with above variables are not defined.
###If you already install mysql and set root password, please give that passwor for DATABASE_PASSWORD.
DATABASE_PASSWORD=openstack
RABBIT_PASSWORD=openstack
SERVICE_TOKEN=openstack
SERVICE_PASSWORD=openstack
ADMIN_PASSWORD=openstack

###Offline:don't reclone from github.
###After devstack installation, you can uncomment following 2 lines and ./unstack and ./stack
#OFFLINE=True
#RECLONE=no

###Interface of VM/System, where you can see the ip.
###You can change it based on your requirement to "lo", "eth0", etc-- and run ./unstack and ./stack.
###Set PUBLIC_INTERFACE=lo to get "127.0.0.1" to all openstack services.
PUBLIC_INTERFACE=eth0

3)
#cd /home/saju/openstack/devstack
#./stack


4)
Fix for the issue: You don't have permission to access / on this server.

Edit horizon.conf
#sudo vim /etc/apache2/sites-available/horizon.conf

Please add the line "Require all granted" as per below:

   Directory />
        Options FollowSymLinks
        AllowOverride None
        Require all granted
    Directory>

5)
#sudo service apache2 restart

6)
Goto http://127.0.0.1

Monday, February 10, 2014

Linux Terminal cowsay Funny Tool Commands Ubuntu Fedora

1)
#sudo apt-get install cowsay

2)
#ls /usr/share/cowsay/cows
apt.cow                ghostbusters.cow  sheep.cow
beavis.zen.cow         gnu.cow           skeleton.cow
bong.cow               head-in.cow       snowman.cow
bud-frogs.cow          hellokitty.cow    sodomized-sheep.cow
bunny.cow              kiss.cow          stegosaurus.cow
calvin.cow             kitty.cow         stimpy.cow
cheese.cow             koala.cow         suse.cow
cock.cow               kosh.cow          three-eyes.cow
cower.cow              luke-koala.cow    turkey.cow
daemon.cow             mech-and-cow.cow  turtle.cow
default.cow            meow.cow          tux.cow
dragon-and-cow.cow     milk.cow          unipony.cow
dragon.cow             moofasa.cow       unipony-smaller.cow
duck.cow               moose.cow         vader.cow
elephant.cow           mutilated.cow     vader-koala.cow
elephant-in-snake.cow  pony.cow          www.cow
eyes.cow               pony-smaller.cow
flaming-sheep.cow      ren.cow



3)
#cowsay -f moose "Hello,How are you"
 ___________________
< Hello,How are you >
 -------------------
  \
   \   \_\_    _/_/
    \      \__/
           (oo)\_______
           (__)\       )\/\
               ||----w |
               ||     ||

How to Linux Terminal Split Screen and Color Split bar or border with Screen

1)
#sudo apt-get install screen

2)
Change color of split bar (border)
Edit ~/.screenrc and add following lines
#vim ~/.screenrc
#White text in Red border/bar
sorendition wr
#or
#White Text in Yellow border
sorendition wy

3)
#screen
Then press enter



4)
Split the Window
Horizontally
Ctrl + a, Then Press Shift + s
or
Vertically
Ctrl + a, Then Press Shift + \

5)
Switch between spilted windows
Ctrl + a, Then Press Tab
or
Ctrl + a, Then Type :focus
* Here :focus is a command

6)
In the spited window use following command to open existing session
Ctrl + a, Then Press 0-9
or
Ctrl + a, Then Press n or p
or
Ctrl + a, Then Press Shift + '
or
Ctrl + a, Then Presss c

7)
Remove current splitted window/region
Ctrl + a, Then Type :remove
* Here :remove is a command
or
Ctrl + a, Then Press Shift + x

8)
Remove all spiltted windows/regions except the current one.
Ctrl + a, Then Type :only
* Here :only is a command
or
Ctrl + a, Then Press Shift +q

9)
Close the screen and all regions
Ctrl + a, Then Press \

How to Linux Terminal Split Screen With Screen

How to split screen
a)
Split the Window
Horizontally
Ctrl + a, Then Press Shift + s
or
Vertically
Ctrl + a, Then Press Shift + \

b)
Switch between spilted windows
Ctrl + a, Then Press Tab
or
Ctrl + a, Then Type :focus
* Here :focus is a command



c)
In the spited window use following command to open existing session
Ctrl + a, Then Press 0-9
or
Ctrl + a, Then Press n or p
or
Ctrl + a, Then Press Shift + ' 
or
Ctrl + a, Then Presss c


d)
Resize a splitted window/region
Ctrl + a, Then Type :resize 25
* Here :resize is a command

e)
Remove current splitted window/region
Ctrl + a, Then Type :remove
* Here :remove is a command
or
Ctrl + a, Then Press Shift + x

f)
Remove all spiltted windows/regions except the current one.
Ctrl + a, Then Type :only
* Here :only is a command
or
Ctrl + a, Then Press Shift +q

g) 
Close the screen and all regions
Ctrl + a, Then Press \

Sunday, February 9, 2014

How to find sencha Ext JS version

alert("---version--"+Ext.version);

Output
=====
---version--3.0

Monday, February 3, 2014

Linux Screen Commands For Developers

1)
List all screen sessions of current user
#screen -ls

2)
To see all screen sessions on a specific machine
#ls -laR /var/run/screen/

3)
To see all commands or parameters on screen.
Ctrl + a, Then Press ?

4)
Open a new screen session
#screen



5)
Detach/Exit from a screen session
Ctrl + a, Then Press d

6)
Kill a screen session
Ctrl + a, Then Press Shift + k

7)
Reattach to a screen session
#screen -r session_id_or_name

8)
How to create multiple screen window/tab in a screen session
Ctrl + a, Then Press c

9)
How to move to next screen window/tab in a screen session
Ctrl + a, Then Press n

10)
How to move to previous screen window/tab in a screen session
Ctrl + a, Then Press p

11)
How to goto n'th screen window/tab
Ctrl + a, Then Press '

12)
How to list name of all screen windows/tabs and select from there
Ctrl + a, Then Press Shift + '

13)
How to switch to screen window/tab 0 - 9
Ctrl + a, Then Press 0 -9

14)
How to Toggle  to  the  window/tab  displayed  previously
Ctrl + a, Then Ctrl + a again

15)
How to change the name of screen window/tab
Ctrl + a, Then Press Shift + a

16)
How to clear a screen window/tab
Ctrl + a, Then Press Shift + c

17)
How to Kill all windows and terminate screen
Ctrl + a, Then Press \
screen -ls

18)
How to lock a screen session
Ctrl + a, Then Press x

19)
How to log a screen session
You will find screenlog.0 file in your home directory.
Ctrl + a, Then Press Shift + h
or
#screen -L (Capital L)

20)
reattach to a specific window/tab in a screen session
#screen -r session_id_or_name -p tab_num_or_name

21)
If a session is running, then reattach. If necessary detach and logout remotely first. If it was not running create it and notify the user.
#screen -D -R

22)
How to create new screen session and specify a meaningful name for the session.
#screen -S session_name

23)
Howto Attach to a not detached screen session.
#screen -x

24)
How to split screen
a)
Split the Window
Horizontally
Ctrl + a, Then Press Shift + s
or
Vertically
Ctrl + a, Then Press Shift + \

b)
Switch between spilted windows
Ctrl + a, Then Press Tab
or
Ctrl + a, Then Type :focus
* Here :focus is a command

c)
In the spited window use following command to open existing session
Ctrl + a, Then Press 0-9
or
Ctrl + a, Then Press n or p
or
Ctrl + a, Then Press Shift + '
or
Ctrl + a, Then Presss c


d)
Resize a splitted window/region
Ctrl + a, Then Type :resize 25
* Here :resize is a command

e)
Remove current splitted window/region
Ctrl + a, Then Type :remove
* Here :remove is a command
or
Ctrl + a, Then Press Shift + x

f)
Remove all spiltted windows/regions except the current one.
Ctrl + a, Then Type :only
* Here :only is a command
or
Ctrl + a, Then Press Shift +q

g)
Change color of split bar (border)
http://michael-prokop.at/computer/config/.screenrc
#vim ~/.screenrc
sorendition 10 74

h)
Close the screen and all regions
Ctrl + a, Then Press \

25)
How to rename an existing session
screen -ls
screen -x old_session_name
Ctrl + a, Then Type :sessionname new_session_name
*Here :sessionname is a command