Use template directory relative to vm.py script
This commit is contained in:
parent
a3ede682b7
commit
3fc7c633d4
5
vm.py
5
vm.py
@ -30,6 +30,8 @@ import ovhtool
|
|||||||
import ovh
|
import ovh
|
||||||
import ovh.exceptions
|
import ovh.exceptions
|
||||||
|
|
||||||
|
BASE = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
'vg': '/dev/vg',
|
'vg': '/dev/vg',
|
||||||
'bridge': 'br0',
|
'bridge': 'br0',
|
||||||
@ -62,7 +64,8 @@ def to_mb(value):
|
|||||||
else:
|
else:
|
||||||
return int(value.lower())
|
return int(value.lower())
|
||||||
|
|
||||||
j2 = jinja2.Environment(loader=jinja2.FileSystemLoader('templates'))
|
j2 = jinja2.Environment(
|
||||||
|
loader=jinja2.FileSystemLoader(os.path.join(BASE, 'templates')))
|
||||||
j2.filters['ipreplace'] = replace_ip
|
j2.filters['ipreplace'] = replace_ip
|
||||||
j2.filters['megabytes'] = to_mb
|
j2.filters['megabytes'] = to_mb
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user