Partial fixes for issues pointed by @rscnt

- Moved opennebula constants to base.py
- Refactored all opennebula functions from admin.py to opennebula_functions.py
- string#format for some strings
- Renamed my_view function to show_vms
- Added logger to show logs of exceptions generated
This commit is contained in:
M.Ravi 2017-04-24 18:51:11 +02:00
commit a8952700d6
4 changed files with 261 additions and 203 deletions

View file

@ -473,4 +473,34 @@ else:
ANONYMOUS_USER_NAME = 'anonymous@ungleich.ch'
GUARDIAN_GET_INIT_ANONYMOUS_USER = 'membership.models.get_anonymous_user_instance'
GUARDIAN_GET_INIT_ANONYMOUS_USER = 'membership.models.get_anonymous_user_instance'
#############################################
# configurations for opennebula-integration #
#############################################
# The oneadmin user name of the OpenNebula infrastructure
OPENNEBULA_USERNAME = 'oneadmin'
# The oneadmin password of the OpenNebula infrastructure
# The default credentials of the Sandbox OpenNebula VM is
# oneadmin:opennebula
OPENNEBULA_PASSWORD = 'opennebula'
# The protocol is generally http or https
OPENNEBULA_PROTOCOL = 'http'
# The ip address or the domain name of the opennebula infrastructure
# OPENNEBULA_DOMAIN = '192.168.182.173'
# OPENNEBULA_DOMAIN = '192.168.122.225'
# OPENNEBULA_DOMAIN = '192.168.182.176'
OPENNEBULA_DOMAIN = '192.168.42.35'
# The port to connect in order to send an xmlrpc request. The default
# port is 2633
OPENNEBULA_PORT = '2633'
# The endpoint to which the XML RPC request needs to be sent to. The
# default value is /RPC2
OPENNEBULA_ENDPOINT = '/RPC2'

View file

@ -19,33 +19,3 @@ INSTALLED_APPS+=(
'django_extensions',
'debug_toolbar'
)
#############################################
# configurations for opennebula-integration #
#############################################
# The user name of the OpenNebula infrastructure
OPENNEBULA_USERNAME = 'oneadmin'
# The password of the OpenNebula infrastructure
# The default credentials of the Sandbox OpenNebula VM is
# oneadmin:opennebula
OPENNEBULA_PASSWORD = 'opennebula'
# The protocol is generally http or https
OPENNEBULA_PROTOCOL = 'http'
# The ip address or the domain name of the opennebula infrastructure
# OPENNEBULA_DOMAIN = '192.168.182.173'
# OPENNEBULA_DOMAIN = '192.168.122.225'
#OPENNEBULA_DOMAIN = '192.168.182.176'
OPENNEBULA_DOMAIN = '192.168.42.35'
# The port to connect in order to send an xmlrpc request. The default
# port is 2633
OPENNEBULA_PORT = '2633'
# The endpoint to which the XML RPC request needs to be sent to. The
# default value is /RPC2
OPENNEBULA_ENDPOINT = '/RPC2'