Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
James Coyle
storjstatus-client
Commits
ab91a878
Commit
ab91a878
authored
Apr 09, 2018
by
James Coyle
Browse files
Merge branch 'james-dev' into 'master'
Bug fix See merge request
!17
parents
123c36a7
1dee8419
Pipeline
#1264
failed with stages
in 47 minutes and 59 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
ab91a878
...
...
@@ -12,6 +12,7 @@ stages:
-
deploy
-
cleanup
-
db
-
github
set-pypirc
:
...
...
@@ -80,3 +81,13 @@ update_db:
-
python3 update-db.py
tags
:
-
storjapi
update_github
:
stage
:
github
only
:
-
master
script
:
-
git remote add github git@github.com:JAC2703/storjstatus-client.git
-
git push github master
tags
:
-
storjapi
storjstatus/storjstatus_register.py
View file @
ab91a878
...
...
@@ -4,7 +4,7 @@ import argparse
import
getpass
import
json
import
os
from
os.path
import
expanduser
import
os.path
import
requests
import
socket
import
ctypes
...
...
@@ -256,12 +256,21 @@ def cron_job():
cron_job_linux
()
def
cron_job_linux
():
tmp_cron
=
'/tmp/storjstatus.cron'
result
=
storjstatus_common
.
subprocess_result
([
'which'
,
'storjstatus-send'
])
if
'storjstatus-send'
in
result
[
0
].
decode
(
'utf-8'
):
send_command
=
result
[
0
].
decode
(
'utf-8'
).
replace
(
'
\n
'
,
''
)
+
' >> /var/log/storjstatus.log 2>&1'
cron
=
CronTab
(
tabfile
=
'/etc/crontab'
,
user
=
False
)
if
os
.
path
.
isfile
(
'/etc/crontab'
):
cron_path
=
'/etc/crontab'
elif
os
.
path
.
isfile
(
'/etc/anacrontab'
):
cron_path
=
'/etc/anacrontab'
else
:
cron_path
=
tmp_cron
cron
=
CronTab
(
tabfile
=
cron_path
,
user
=
False
)
# Check for existing cronjob and remove
cron
.
remove_all
(
comment
=
'storjstatus'
)
...
...
@@ -279,12 +288,11 @@ def cron_job_linux():
minute
=
cron_minute
(
minute
)
job
.
minute
.
also
.
on
(
minute
)
try
:
cron
.
write
()
storjstatus_common
.
subprocess_result
([
'service'
,
'cron'
,
'reload'
])
print
(
"Cron set for: "
+
job
.
render
())
except
PermissionError
:
print_error
(
'Unable to create cron job. Exiting.'
)
if
cron_path
==
tmp_cron
:
print
(
'*************************WARNING************************************'
)
print
(
'Could not find your system cronfile, please add a cron manually for:'
)
print
(
' '
+
job
.
render
())
print
(
'*************************WARNING************************************'
)
else
:
print_error
(
'There was an error finding the storjstatus-send command. Check your storjstatus installation.'
)
...
...
storjstatus/version.py
View file @
ab91a878
__version__
=
'0.3.
3
'
__version__
=
'0.3.
5
'
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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