Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
settingsd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
settingsd
Commits
48fa84be
Commit
48fa84be
authored
Jan 19, 2011
by
Devaev Maxim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New validators in plugins
parent
a11d63f5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
fmod_dnsmasq_config.py
plugins/functions/fmod_dnsmasq_config.py
+4
-4
fmod_machine.py
plugins/functions/fmod_machine.py
+1
-1
No files found.
plugins/functions/fmod_dnsmasq_config.py
View file @
48fa84be
...
@@ -33,7 +33,7 @@ class SimpleDnsmasqConfig(service.FunctionObject) :
...
@@ -33,7 +33,7 @@ class SimpleDnsmasqConfig(service.FunctionObject) :
@service.functionMethod
(
SIMPLE_METHODS_NAMESPACE
,
in_signature
=
"as"
)
@service.functionMethod
(
SIMPLE_METHODS_NAMESPACE
,
in_signature
=
"as"
)
def
setServers
(
self
,
servers_list
)
:
def
setServers
(
self
,
servers_list
)
:
for
servers_list_item
in
servers_list
:
for
servers_list_item
in
servers_list
:
validators
.
validIpv4Address
(
servers_list_item
)
validators
.
network
.
validIpv4Address
(
servers_list_item
)
self
.
setConfigValue
(
"server"
,
servers_list
)
self
.
setConfigValue
(
"server"
,
servers_list
)
@service.functionMethod
(
SIMPLE_METHODS_NAMESPACE
,
out_signature
=
"as"
)
@service.functionMethod
(
SIMPLE_METHODS_NAMESPACE
,
out_signature
=
"as"
)
...
@@ -64,8 +64,8 @@ class SimpleDnsmasqConfig(service.FunctionObject) :
...
@@ -64,8 +64,8 @@ class SimpleDnsmasqConfig(service.FunctionObject) :
@service.functionMethod
(
SIMPLE_METHODS_NAMESPACE
,
in_signature
=
"ssss"
)
@service.functionMethod
(
SIMPLE_METHODS_NAMESPACE
,
in_signature
=
"ssss"
)
def
setRange
(
self
,
start_ip
,
stop_ip
,
netmask
,
lease
)
:
def
setRange
(
self
,
start_ip
,
stop_ip
,
netmask
,
lease
)
:
dhcp_range
=
"
%
s,
%
s"
%
(
validators
.
validIpv4Address
(
start_ip
)[
0
],
validators
.
validIpv4Address
(
stop_ip
)[
0
])
dhcp_range
=
"
%
s,
%
s"
%
(
validators
.
network
.
validIpv4Address
(
start_ip
)[
0
],
validators
.
network
.
validIpv4Address
(
stop_ip
)[
0
])
dhcp_range
+=
(
",
%
s"
%
(
validators
.
validIpv4Netmask
(
netmask
)[
0
])
if
len
(
netmask
)
!=
0
else
""
)
dhcp_range
+=
(
",
%
s"
%
(
validators
.
network
.
validIpv4Netmask
(
netmask
)[
0
])
if
len
(
netmask
)
!=
0
else
""
)
dhcp_range
+=
(
",
%
s"
%
(
lease
)
if
len
(
lease
)
!=
0
else
""
)
dhcp_range
+=
(
",
%
s"
%
(
lease
)
if
len
(
lease
)
!=
0
else
""
)
self
.
setConfigValue
(
"dhcp-range"
,
dhcp_range
)
self
.
setConfigValue
(
"dhcp-range"
,
dhcp_range
)
...
@@ -82,7 +82,7 @@ class SimpleDnsmasqConfig(service.FunctionObject) :
...
@@ -82,7 +82,7 @@ class SimpleDnsmasqConfig(service.FunctionObject) :
@service.functionMethod
(
SIMPLE_METHODS_NAMESPACE
,
in_signature
=
"sss"
)
@service.functionMethod
(
SIMPLE_METHODS_NAMESPACE
,
in_signature
=
"sss"
)
def
addStaticHost
(
self
,
mac
,
ip
,
name
)
:
def
addStaticHost
(
self
,
mac
,
ip
,
name
)
:
static_host
=
"
%
s,
%
s"
%
(
validators
.
validMacAddress
(
mac
)[
0
],
validators
.
validIpv4Address
(
ip
)[
0
])
static_host
=
"
%
s,
%
s"
%
(
validators
.
network
.
validMacAddress
(
mac
)[
0
],
validators
.
network
.
validIpv4Address
(
ip
)[
0
])
static_host
+=
(
",
%
s"
%
(
name
)
if
len
(
name
)
!=
0
else
""
)
static_host
+=
(
",
%
s"
%
(
name
)
if
len
(
name
)
!=
0
else
""
)
self
.
setConfigValue
(
"dhcp-host"
,
static_host
,
False
)
self
.
setConfigValue
(
"dhcp-host"
,
static_host
,
False
)
...
...
plugins/functions/fmod_machine.py
View file @
48fa84be
...
@@ -43,7 +43,7 @@ class Machine(service.FunctionObject) :
...
@@ -43,7 +43,7 @@ class Machine(service.FunctionObject) :
@service.functionMethod
(
RUNLEVELS_METHODS_NAMESPACE
,
in_signature
=
"i"
,
out_signature
=
"i"
)
@service.functionMethod
(
RUNLEVELS_METHODS_NAMESPACE
,
in_signature
=
"i"
,
out_signature
=
"i"
)
def
switchTo
(
self
,
level
)
:
def
switchTo
(
self
,
level
)
:
proc_args
=
"
%
s
%
s"
%
(
config
.
value
(
SERVICE_NAME
,
"telinit_prog_path"
),
validators
.
validRange
(
str
(
level
),
RUNLEVELS
))
proc_args
=
"
%
s
%
s"
%
(
config
.
value
(
SERVICE_NAME
,
"telinit_prog_path"
),
validators
.
common
.
validRange
(
str
(
level
),
RUNLEVELS
))
return
tools
.
execProcess
(
proc_args
,
False
)[
2
]
return
tools
.
execProcess
(
proc_args
,
False
)[
2
]
@service.functionMethod
(
RUNLEVELS_METHODS_NAMESPACE
,
out_signature
=
"i"
)
@service.functionMethod
(
RUNLEVELS_METHODS_NAMESPACE
,
out_signature
=
"i"
)
...
...
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