Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
S
scom
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
SulinOS
scom
Commits
4b688f80
Kaydet (Commit)
4b688f80
authored
Eyl 26, 2017
tarafından
Suleyman Poyraz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bu gece zabaha gaddar dans
üst
954374dc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
30 deletions
+30
-30
service.py
api/scom/service.py
+30
-30
No files found.
api/scom/service.py
Dosyayı görüntüle @
4b688f80
...
...
@@ -54,15 +54,15 @@ def is_on():
if
not
os
.
access
(
_dir
,
os
.
W_OK
):
os
.
makedirs
(
_dir
)
makeDir
(
"/etc/
mudur
/services/enabled"
)
makeDir
(
"/etc/
mudur
/services/disabled"
)
makeDir
(
"/etc/
mudur
/services/conditional"
)
makeDir
(
"/etc/
scomd
/services/enabled"
)
makeDir
(
"/etc/
scomd
/services/disabled"
)
makeDir
(
"/etc/
scomd
/services/conditional"
)
if
os
.
access
(
os
.
path
.
join
(
"/etc/
mudur
/services/enabled"
,
script
()),
os
.
F_OK
):
if
os
.
access
(
os
.
path
.
join
(
"/etc/
scomd
/services/enabled"
,
script
()),
os
.
F_OK
):
state
=
"on"
elif
os
.
access
(
os
.
path
.
join
(
"/etc/
mudur
/services/disabled"
,
script
()),
os
.
F_OK
):
elif
os
.
access
(
os
.
path
.
join
(
"/etc/
scomd
/services/disabled"
,
script
()),
os
.
F_OK
):
state
=
"off"
elif
os
.
access
(
os
.
path
.
join
(
"/etc/
mudur
/services/conditional"
,
script
()),
os
.
F_OK
):
elif
os
.
access
(
os
.
path
.
join
(
"/etc/
scomd
/services/conditional"
,
script
()),
os
.
F_OK
):
state
=
"conditional"
return
state
...
...
@@ -427,28 +427,28 @@ def setState(state=None):
def
remove
(
_file
):
os
.
unlink
(
_file
)
makeDir
(
"/etc/
mudur
/services/enabled"
)
makeDir
(
"/etc/
mudur
/services/disabled"
)
makeDir
(
"/etc/
mudur
/services/conditional"
)
makeDir
(
"/etc/
scomd
/services/enabled"
)
makeDir
(
"/etc/
scomd
/services/disabled"
)
makeDir
(
"/etc/
scomd
/services/conditional"
)
if
state
==
"on"
:
touch
(
os
.
path
.
join
(
"/etc/
mudur
/services/enabled"
,
script
()))
if
os
.
access
(
os
.
path
.
join
(
"/etc/
mudur
/services/disabled"
,
script
()),
os
.
F_OK
):
remove
(
os
.
path
.
join
(
"/etc/
mudur
/services/disabled"
,
script
()))
if
os
.
access
(
os
.
path
.
join
(
"/etc/
mudur
/services/conditional"
,
script
()),
os
.
F_OK
):
remove
(
os
.
path
.
join
(
"/etc/
mudur
/services/conditional"
,
script
()))
touch
(
os
.
path
.
join
(
"/etc/
scomd
/services/enabled"
,
script
()))
if
os
.
access
(
os
.
path
.
join
(
"/etc/
scomd
/services/disabled"
,
script
()),
os
.
F_OK
):
remove
(
os
.
path
.
join
(
"/etc/
scomd
/services/disabled"
,
script
()))
if
os
.
access
(
os
.
path
.
join
(
"/etc/
scomd
/services/conditional"
,
script
()),
os
.
F_OK
):
remove
(
os
.
path
.
join
(
"/etc/
scomd
/services/conditional"
,
script
()))
elif
state
==
"off"
:
touch
(
os
.
path
.
join
(
"/etc/
mudur
/services/disabled"
,
script
()))
if
os
.
access
(
os
.
path
.
join
(
"/etc/
mudur
/services/enabled"
,
script
()),
os
.
F_OK
):
remove
(
os
.
path
.
join
(
"/etc/
mudur
/services/enabled"
,
script
()))
if
os
.
access
(
os
.
path
.
join
(
"/etc/
mudur
/services/conditional"
,
script
()),
os
.
F_OK
):
remove
(
os
.
path
.
join
(
"/etc/
mudur
/services/conditional"
,
script
()))
touch
(
os
.
path
.
join
(
"/etc/
scomd
/services/disabled"
,
script
()))
if
os
.
access
(
os
.
path
.
join
(
"/etc/
scomd
/services/enabled"
,
script
()),
os
.
F_OK
):
remove
(
os
.
path
.
join
(
"/etc/
scomd
/services/enabled"
,
script
()))
if
os
.
access
(
os
.
path
.
join
(
"/etc/
scomd
/services/conditional"
,
script
()),
os
.
F_OK
):
remove
(
os
.
path
.
join
(
"/etc/
scomd
/services/conditional"
,
script
()))
else
:
touch
(
os
.
path
.
join
(
"/etc/
mudur
/services/conditional"
,
script
()))
if
os
.
access
(
os
.
path
.
join
(
"/etc/
mudur
/services/enabled"
,
script
()),
os
.
F_OK
):
remove
(
os
.
path
.
join
(
"/etc/
mudur
/services/enabled"
,
script
()))
if
os
.
access
(
os
.
path
.
join
(
"/etc/
mudur
/services/disabled"
,
script
()),
os
.
F_OK
):
remove
(
os
.
path
.
join
(
"/etc/
mudur
/services/disabled"
,
script
()))
touch
(
os
.
path
.
join
(
"/etc/
scomd
/services/conditional"
,
script
()))
if
os
.
access
(
os
.
path
.
join
(
"/etc/
scomd
/services/enabled"
,
script
()),
os
.
F_OK
):
remove
(
os
.
path
.
join
(
"/etc/
scomd
/services/enabled"
,
script
()))
if
os
.
access
(
os
.
path
.
join
(
"/etc/
scomd
/services/disabled"
,
script
()),
os
.
F_OK
):
remove
(
os
.
path
.
join
(
"/etc/
scomd
/services/disabled"
,
script
()))
notify
(
"System.Service"
,
"Changed"
,
(
script
(),
state
))
...
...
@@ -460,8 +460,8 @@ def registerState():
def
touch
(
_file
):
file
(
_file
,
"w"
)
.
close
()
makeDir
(
"/etc/
mudur
/services/enabled"
)
makeDir
(
"/etc/
mudur
/services/conditional"
)
makeDir
(
"/etc/
scomd
/services/enabled"
)
makeDir
(
"/etc/
scomd
/services/conditional"
)
state
=
None
try
:
...
...
@@ -471,8 +471,8 @@ def registerState():
pass
if
state
==
"on"
:
if
script
()
not
in
os
.
listdir
(
"/etc/
mudur
/services/disabled"
):
touch
(
os
.
path
.
join
(
"/etc/
mudur
/services/enabled"
,
script
()))
if
script
()
not
in
os
.
listdir
(
"/etc/
scomd
/services/disabled"
):
touch
(
os
.
path
.
join
(
"/etc/
scomd
/services/enabled"
,
script
()))
elif
state
==
"conditional"
:
if
script
()
not
in
os
.
listdir
(
"/etc/
mudur
/services/disabled"
):
touch
(
os
.
path
.
join
(
"/etc/
mudur
/services/conditional"
,
script
()))
if
script
()
not
in
os
.
listdir
(
"/etc/
scomd
/services/disabled"
):
touch
(
os
.
path
.
join
(
"/etc/
scomd
/services/conditional"
,
script
()))
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