First set of working module structure
This commit is contained in:
commit
aa73290eb2
|
@ -0,0 +1,13 @@
|
||||||
|
import os, sys
|
||||||
|
sys.path.append(os.path.join(os.path.dirname(__file__), "lib"))
|
||||||
|
|
||||||
|
import myOpenstackApp
|
||||||
|
|
||||||
|
|
||||||
|
y=myOpenstackApp.OSC
|
||||||
|
y.initalise()
|
||||||
|
# y.ks.getCatalog()
|
||||||
|
y.something()
|
||||||
|
# print(y._keystone)
|
||||||
|
|
||||||
|
print("Starting")
|
|
@ -0,0 +1,27 @@
|
||||||
|
class OpenStackConnection_x:
|
||||||
|
someProp=0
|
||||||
|
ks=False
|
||||||
|
nova=False
|
||||||
|
|
||||||
|
catalogData=""
|
||||||
|
novaURL=""
|
||||||
|
|
||||||
|
"""
|
||||||
|
It's important not to initalise any of the submodules during the init cycle becuase thic causes cirtucalr import loops
|
||||||
|
The initalise function exists for this reas and should be caled by the client application using this module
|
||||||
|
"""
|
||||||
|
def __init__(self) -> None:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def initalise(self) -> None:
|
||||||
|
from myOpenstackApp.keystone import myopenstack_keystone
|
||||||
|
from myOpenstackApp.nova import myopenstack_nova
|
||||||
|
|
||||||
|
self.ks=myopenstack_keystone(self)
|
||||||
|
self.nova=myopenstack_nova(self)
|
||||||
|
pass
|
||||||
|
|
||||||
|
def something(_self):
|
||||||
|
print(1)
|
||||||
|
_self.ks.getCatalog()
|
||||||
|
_self.nova.showNovaURL()
|
|
@ -0,0 +1,3 @@
|
||||||
|
from myOpenstackApp import OpenStackConnection
|
||||||
|
|
||||||
|
OSC=OpenStackConnection.OpenStackConnection_x()
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,16 @@
|
||||||
|
import myOpenstackApp.OpenStackConnection
|
||||||
|
|
||||||
|
|
||||||
|
class myopenstack_keystone():
|
||||||
|
|
||||||
|
def __init__(self,conn ) -> None:
|
||||||
|
self.conn=conn
|
||||||
|
|
||||||
|
def echo(_self):
|
||||||
|
print("Helllooo")
|
||||||
|
|
||||||
|
|
||||||
|
def getCatalog(_self):
|
||||||
|
catalog="Some shit, more shit"
|
||||||
|
_self.conn.catalogData=catalog
|
||||||
|
_self.conn.novaURL="http://nova"
|
|
@ -0,0 +1,17 @@
|
||||||
|
import myOpenstackApp.OpenStackConnection
|
||||||
|
|
||||||
|
|
||||||
|
class myopenstack_nova():
|
||||||
|
|
||||||
|
def __init__(self,conn: myOpenstackApp.OpenStackConnection.OpenStackConnection_x ) -> None:
|
||||||
|
self.conn=conn
|
||||||
|
|
||||||
|
def addNewVM(_self,Name, flavor):
|
||||||
|
return(Name)
|
||||||
|
|
||||||
|
def getKeystone(_self):
|
||||||
|
_self.myOpenstackObject.keystone.echo()
|
||||||
|
|
||||||
|
def showNovaURL(_self):
|
||||||
|
print(_self.conn.novaURL)
|
||||||
|
_self.conn
|
Loading…
Reference in New Issue