Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE3
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
5
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
3cb1a197
authored
Oct 18, 2022
by
Karsa Zoltán István
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update default network config and set mac addr tolower
parent
a2f4cde8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
14 deletions
+13
-14
circle/vm/models/instance.py
+13
-14
No files found.
circle/vm/models/instance.py
View file @
3cb1a197
...
@@ -104,18 +104,17 @@ chpasswd:
...
@@ -104,18 +104,17 @@ chpasswd:
"""
.
strip
()
"""
.
strip
()
CI_NETWORK_CONFIG_DEF
=
"""
CI_NETWORK_CONFIG_DEF
=
"""
network:
version: 2
version: 2
ethernets:
ethernets:
ens3:
ens3:
match:
match:
macaddress: '{{ net.mac }}'
macaddress: {{ net.mac }}
addresses:
addresses:
- {{ net.ipv4 }}/{{ net.mask4 }}
- {{ net.ipv4 }}/{{ net.mask4 }}
gateway4: {{ net.gateway4 }}
gateway4: {{ net.gateway4 }}
nameservers:
nameservers:
addresses:
addresses:
- 8.8.8.8
- 8.8.8.8
"""
.
strip
()
"""
.
strip
()
try
:
try
:
...
@@ -319,13 +318,13 @@ class NetTemplate:
...
@@ -319,13 +318,13 @@ class NetTemplate:
self
.
name
=
str
(
net
.
vlan
.
name
)
self
.
name
=
str
(
net
.
vlan
.
name
)
self
.
gateway4
=
str
(
net
.
vlan
.
network4
)
.
split
(
"/"
)[
0
]
self
.
gateway4
=
str
(
net
.
vlan
.
network4
)
.
split
(
"/"
)[
0
]
self
.
mask4
=
str
(
net
.
vlan
.
network4
)
.
split
(
"/"
)[
1
]
self
.
mask4
=
str
(
net
.
vlan
.
network4
)
.
split
(
"/"
)[
1
]
self
.
mac
=
str
(
net
.
host
.
mac
)
self
.
mac
=
str
(
net
.
host
.
mac
)
.
lower
()
def
__init__
(
self
,
instance
):
def
__init__
(
self
,
instance
):
self
.
vlans
=
list
(
NetTemplate
.
Host
(
net
)
for
net
in
instance
.
interface_set
.
all
()
if
net
.
host
)
self
.
vlans
=
list
(
NetTemplate
.
Host
(
net
)
for
net
in
instance
.
interface_set
.
all
()
if
net
.
host
)
self
.
ipv4
=
str
(
instance
.
ipv4
)
self
.
ipv4
=
str
(
instance
.
ipv4
)
self
.
ipv6
=
str
(
instance
.
ipv6
)
self
.
ipv6
=
str
(
instance
.
ipv6
)
self
.
mac
=
str
(
instance
.
mac
)
self
.
mac
=
str
(
instance
.
mac
)
.
lower
()
if
instance
.
primary_host
:
if
instance
.
primary_host
:
addr
=
str
(
instance
.
primary_host
.
vlan
.
network4
)
.
split
(
"/"
)
addr
=
str
(
instance
.
primary_host
.
vlan
.
network4
)
.
split
(
"/"
)
self
.
gateway4
=
addr
[
0
]
self
.
gateway4
=
addr
[
0
]
...
...
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