Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Titouan Soulard
slapos.core
Commits
347dc0ac
Commit
347dc0ac
authored
Jan 23, 2012
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use new-style classes.
parent
394e568d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
slapos/format.py
slapos/format.py
+7
-7
No files found.
slapos/format.py
View file @
347dc0ac
...
@@ -156,7 +156,7 @@ def _getDict(instance):
...
@@ -156,7 +156,7 @@ def _getDict(instance):
result
[
key
]
=
_getDict
(
value
)
result
[
key
]
=
_getDict
(
value
)
return
result
return
result
class
Computer
:
class
Computer
(
object
)
:
"Object representing the computer"
"Object representing the computer"
instance_root
=
None
instance_root
=
None
software_root
=
None
software_root
=
None
...
@@ -376,7 +376,7 @@ class Computer:
...
@@ -376,7 +376,7 @@ class Computer:
except
IndexError
:
except
IndexError
:
pass
pass
class
Partition
:
class
Partition
(
object
)
:
"Represent a computer partition"
"Represent a computer partition"
def
__init__
(
self
,
reference
,
path
,
user
,
address_list
,
tap
):
def
__init__
(
self
,
reference
,
path
,
user
,
address_list
,
tap
):
...
@@ -413,7 +413,7 @@ class Partition:
...
@@ -413,7 +413,7 @@ class Partition:
os
.
chown
(
self
.
path
,
owner_pw
.
pw_uid
,
owner_pw
.
pw_gid
)
os
.
chown
(
self
.
path
,
owner_pw
.
pw_uid
,
owner_pw
.
pw_gid
)
os
.
chmod
(
self
.
path
,
0750
)
os
.
chmod
(
self
.
path
,
0750
)
class
User
:
class
User
(
object
)
:
"User: represent and manipulate a user on the system."
"User: represent and manipulate a user on the system."
path
=
None
path
=
None
...
@@ -482,7 +482,7 @@ import fcntl
...
@@ -482,7 +482,7 @@ import fcntl
import
errno
import
errno
import
threading
import
threading
class
Tap
:
class
Tap
(
object
)
:
"Tap represent a tap interface on the system"
"Tap represent a tap interface on the system"
IFF_TAP
=
0x0002
IFF_TAP
=
0x0002
TUNSETIFF
=
0x400454ca
TUNSETIFF
=
0x400454ca
...
@@ -572,7 +572,7 @@ class Tap:
...
@@ -572,7 +572,7 @@ class Tap:
if
attach_to_tap
:
if
attach_to_tap
:
threading
.
Thread
(
target
=
self
.
attach
).
start
()
threading
.
Thread
(
target
=
self
.
attach
).
start
()
class
Bridge
:
class
Bridge
(
object
)
:
"Bridge represent a bridge on the system"
"Bridge represent a bridge on the system"
def
__init__
(
self
,
name
,
ipv4_local_network
,
ipv6_interface
=
None
):
def
__init__
(
self
,
name
,
ipv4_local_network
,
ipv6_interface
=
None
):
...
@@ -989,7 +989,7 @@ def run(config):
...
@@ -989,7 +989,7 @@ def run(config):
config
.
logger
.
info
(
'Posting information to %r'
%
config
.
master_url
)
config
.
logger
.
info
(
'Posting information to %r'
%
config
.
master_url
)
computer
.
send
(
config
)
computer
.
send
(
config
)
class
Config
:
class
Config
(
object
)
:
key_file
=
None
key_file
=
None
cert_file
=
None
cert_file
=
None
alter_network
=
None
alter_network
=
None
...
@@ -1145,7 +1145,7 @@ def main(*args):
...
@@ -1145,7 +1145,7 @@ def main(*args):
return
True
return
True
Bridge
.
_addSystemAddress
=
fake_addSystemAddress
Bridge
.
_addSystemAddress
=
fake_addSystemAddress
def
fake_getpwnam
(
user
):
def
fake_getpwnam
(
user
):
class
result
:
class
result
(
object
)
:
pw_uid
=
12345
pw_uid
=
12345
pw_gid
=
54321
pw_gid
=
54321
return
result
return
result
...
...
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