Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
RECIRCLE
/
interface-openstack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
2
Merge Requests
4
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
10f3194e
authored
Jul 09, 2019
by
Chif Gergő
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create connection class
parent
dc7e976d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
implementation/utils/connection.py
+26
-0
No files found.
implementation/utils/connection.py
0 → 100644
View file @
10f3194e
import
openstack
from
keystoneauth1.identity
import
v3
from
keystoneauth1
import
session
class
OpenStackConnection
(
object
):
"""Class for handling the connection to the OpenStack Manager.
It creates a connection member variable which holds the connection.
The connection only connects when something called in it."""
def
__init__
(
self
,
auth
):
super
(
OpenStackConnection
,
self
)
.
__init__
()
self
.
openstack
=
openstack
.
connect
(
auth_url
=
auth
[
"auth_url"
],
username
=
auth
[
"username"
],
password
=
auth
[
"password"
],
project_id
=
auth
[
"project_id"
],
project_name
=
auth
[
"project_name"
],
region_name
=
auth
[
"region_name"
]
)
client_auth
=
v3
.
Password
(
auth_url
=
auth
[
"auth_url"
],
username
=
auth
[
"username"
],
password
=
auth
[
"password"
],
user_domain_id
=
auth
[
"user_domain_id"
],
project_id
=
auth
[
"project_id"
],)
self
.
client_session
=
session
.
Session
(
auth
=
client_auth
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment