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
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
circle/vm/models/instance.py
+5
-6
No files found.
circle/vm/models/instance.py
View file @
3cb1a197
...
...
@@ -104,12 +104,11 @@ chpasswd:
"""
.
strip
()
CI_NETWORK_CONFIG_DEF
=
"""
network:
version: 2
ethernets:
version: 2
ethernets:
ens3:
match:
macaddress: {{ net.mac }}
macaddress: '{{ net.mac }}'
addresses:
- {{ net.ipv4 }}/{{ net.mask4 }}
gateway4: {{ net.gateway4 }}
...
...
@@ -319,13 +318,13 @@ class NetTemplate:
self
.
name
=
str
(
net
.
vlan
.
name
)
self
.
gateway4
=
str
(
net
.
vlan
.
network4
)
.
split
(
"/"
)[
0
]
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
):
self
.
vlans
=
list
(
NetTemplate
.
Host
(
net
)
for
net
in
instance
.
interface_set
.
all
()
if
net
.
host
)
self
.
ipv4
=
str
(
instance
.
ipv4
)
self
.
ipv6
=
str
(
instance
.
ipv6
)
self
.
mac
=
str
(
instance
.
mac
)
self
.
mac
=
str
(
instance
.
mac
)
.
lower
()
if
instance
.
primary_host
:
addr
=
str
(
instance
.
primary_host
.
vlan
.
network4
)
.
split
(
"/"
)
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