Commit f68fe68d authored by Lucas's avatar Lucas
Browse files

SCRUM#556: Update lelab's methods calls to the new syntax

parent 88f3de11
Pipeline #16369 canceled with stages
in 6 seconds
le-epoptes (1.0.0) unstable; urgency=medium
* Update lelab's methods calls to the new syntax (Closes: #556)
* debian/control: Update pre-dependency clause to 'le-lab (>= 1.0.0)'
* debian/postinst: Update lelab's restart call to the new syntax
-- Lucas Sulzbach <lesuporte@c3sl.ufpr.br> Fri, 08 Jun 2018 11:05:53 -0300
le-epoptes (0.1.0) unstable; urgency=medium
* Create le-lab attributes to enable/disable epoptes (Closes: #534)
* debian/control: New uploader
-- Lucas Sulzbach <ls17@c3sl.ufpr.br> Fri, 29 Jun 2018 08:57:10 -0300
-- Lucas Sulzbach <lesuporte@c3sl.ufpr.br> Fri, 29 Jun 2018 08:57:10 -0300
le-epoptes (0.0.20) testing; urgency=medium
......
......@@ -13,7 +13,7 @@ Package: le-epoptes
Architecture: all
Depends: ${python3:Depends}, ${misc:Depends}, python3-dbus, epoptes, epoptes-client, gnome-shell-extensions, notify-osd, libnotify-bin
Recommends: le-help
Pre-Depends: le-lab (>= 0.2.0)
Pre-Depends: le-lab (>= 1.0.0)
Description: Automatic set up epoptes in a local network
Epoptes is an open source computer lab management and monitoring tool.
This package installs an implementation based on le-lab that automates the
......
......@@ -60,7 +60,7 @@ if ! test -f /etc/default/version || grep -q "Escola" /etc/default/version; then
fi
# Restart le-lab
le-lab -s restart > /dev/null || true
le-lab --restart > /dev/null || true
if $restart; then
echo "Please restart your session to complete the installation process."
......
......@@ -74,7 +74,7 @@ class LEEpoptes(object):
def run(self):
my_server = self.get_current_server()
current_server = self.conn.epoptes_get_attribute('_server')
current_server = self.conn.get_attribute('epoptes', '_server')
logging.debug("Checking server my_server=%s, current_server=%s",
my_server, current_server)
......@@ -91,12 +91,12 @@ class LEEpoptes(object):
logging.info("The current server is %s. Changing server to local machine instead.", current_server)
logging.info("Starting server %s", my_server)
self.conn.epoptes_advertise()
self.conn.advertise('epoptes')
if self.wait_for_lelab():
self.open_epoptes()
logging.info("Closing server %s", my_server)
self.conn.epoptes_remove()
self.conn.remove('epoptes')
logging.debug("Server %s closed", my_server)
else:
......@@ -116,7 +116,7 @@ class LEEpoptes(object):
# Wait for le-lab to register the epoptes service
timeout = 0
while True:
if self.conn.epoptes_get_attribute('_status') == 'server':
if self.conn.get_attribute('epoptes', '_status') == 'server':
break
timeout += 1
......
......@@ -145,8 +145,8 @@ class LEEpoptes_control(object):
Called when a local epoptes service is detected
"""
status = self.conn.epoptes_get_attribute('_status')
server = self.conn.epoptes_get_attribute('_server')
status = self.conn.get_attribute('epoptes', '_status')
server = self.conn.get_attribute('epoptes', '_server')
if status == 'client':
self.update_server('pre_server',server)
......@@ -162,8 +162,8 @@ class LEEpoptes_control(object):
Called when a local epoptes service disconnects
"""
status = self.conn.epoptes_get_attribute('_status')
server = self.conn.epoptes_get_attribute('_server')
status = self.conn.get_attribute('epoptes', '_status')
server = self.conn.get_attribute('epoptes', '_server')
if status == 'pre_client':
self.update_server('client',server)
......@@ -176,13 +176,13 @@ class LEEpoptes_control(object):
Called when a remote epoptes service is detected
"""
status = self.conn.epoptes_get_attribute('_status')
hosts = self.conn.epoptes_get_connected_hosts()
status = self.conn.get_attribute('epoptes', '_status')
hosts = self.conn.get_connected_hosts('epoptes')
while status == 'disabled' and hosts:
time.sleep(0.5)
status = self.conn.epoptes_get_attribute('_status')
hosts = self.conn.epoptes_get_connected_hosts()
status = self.conn.get_attribute('epoptes', '_status')
hosts = self.conn.get_connected_hosts('epoptes')
if status == 'server':
status = 'pre_client'
......@@ -198,8 +198,8 @@ class LEEpoptes_control(object):
Called when a remote epoptes service disconnects
"""
status = self.conn.epoptes_get_attribute('_status')
server = self.conn.epoptes_get_attribute('_server')
status = self.conn.get_attribute('epoptes', '_status')
server = self.conn.get_attribute('epoptes', '_server')
if status == 'pre_server':
self.update_server('server',socket.gethostname())
......@@ -221,8 +221,8 @@ class LEEpoptes_control(object):
logging.info("epoptes updating machine status to %s,%s", status, host)
self.update_epoptes(status,host)
self.conn.epoptes_set_attribute('_status', status)
self.conn.epoptes_set_attribute('_server', host)
self.conn.set_attribute('epoptes', '_status', status)
self.conn.set_attribute('epoptes', '_server', host)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment