From dbae608cd1979878889a51e8accfd3cbe504b77f Mon Sep 17 00:00:00 2001 From: dwlee Date: Tue, 23 Dec 2014 16:53:19 +0900 Subject: [PATCH 1/4] make test brach --- .../src/rocon_remocon/interactive_client.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/rocon_remocon/src/rocon_remocon/interactive_client.py b/rocon_remocon/src/rocon_remocon/interactive_client.py index b36da36..a3c7840 100644 --- a/rocon_remocon/src/rocon_remocon/interactive_client.py +++ b/rocon_remocon/src/rocon_remocon/interactive_client.py @@ -86,12 +86,17 @@ def __init__(self, stop_interaction_postexec_fn): # expose underlying functionality higher up self.interactions = self._interactions_table.generate_role_view """Get a dictionary of interactions belonging to the specified role.""" + self.ros_master_uri = "" + self.host_name = "" def _connect(self, rocon_master_name="", ros_master_uri="http://localhost:11311", host_name='localhost'): # uri is obtained from the user, stored in ros_master_uri os.environ["ROS_MASTER_URI"] = ros_master_uri os.environ["ROS_HOSTNAME"] = host_name + self.ros_master_uri = ros_master_uri + self.host_name = host_name + self._ros_master_port = urlparse(os.environ["ROS_MASTER_URI"]).port console.logdebug("Interactive Client : Connection Details") @@ -104,8 +109,11 @@ def _connect(self, rocon_master_name="", ros_master_uri="http://localhost:11311" # for the remocon-role manager interaction anyway: rospy.init_node(self.name, disable_signals=True) try: + print "get_interactions_service_name" get_interactions_service_name = rocon_python_comms.find_service('rocon_interaction_msgs/GetInteractions', timeout=rospy.rostime.Duration(5.0), unique=True) + print "get_roles_service_name" get_roles_service_name = rocon_python_comms.find_service('rocon_interaction_msgs/GetRoles', timeout=rospy.rostime.Duration(5.0), unique=True) + print "request_interaction_service_name" request_interaction_service_name = rocon_python_comms.find_service('rocon_interaction_msgs/RequestInteraction', timeout=rospy.rostime.Duration(5.0), unique=True) except rocon_python_comms.NotFoundException as e: message = "failed to find all of the interactions' publications and services [%s]" % str(e) @@ -119,13 +127,16 @@ def _connect(self, rocon_master_name="", ros_master_uri="http://localhost:11311" try: # if its available, should be quick to find this one since we found the others... + print "pairing_topic_name" pairing_topic_name = rocon_python_comms.find_topic('rocon_interaction_msgs/Pair', timeout=rospy.rostime.Duration(0.5), unique=True) + self.pairing_status_subscriber = rospy.Subscriber(pairing_topic_name, rocon_interaction_msgs.Pair, self._subscribe_pairing_status_callback) except rocon_python_comms.NotFoundException as e: console.logdebug("Interactive Client : support for paired interactions disabled [not found]") self._publish_remocon_status() self.is_connect = True + print "Connecting!!!" return (True, "success") def shutdown(self): @@ -289,8 +300,12 @@ def _start_roslaunch_interaction(self, interaction, roslaunch_filename): args=self._prepare_roslaunch_args(interaction.parameters), options="--screen" ) + env = {} + env['ROS_MASTER_URI'] = self.ros_master_uri + env['ROS_HOSTNAME'] = self.host_name + process_listener = partial(self._process_listeners, anonymous_name, 1) - (process, meta_roslauncher) = self._roslaunch_terminal.spawn_roslaunch_window(launch_configuration, postexec_fn=process_listener) + (process, meta_roslauncher) = self._roslaunch_terminal.spawn_roslaunch_window(launch_configuration, postexec_fn=process_listener, env = env) interaction.launch_list[anonymous_name] = RosLaunchInfo(anonymous_name, True, process, self._roslaunch_terminal.shutdown_roslaunch_windows, [meta_roslauncher]) return True From 9b200fa55ca8dad759509b4179edec188dfb15fa Mon Sep 17 00:00:00 2001 From: dwlee Date: Mon, 19 Jan 2015 13:40:40 +0900 Subject: [PATCH 2/4] update ros service and subscriber init function --- .../src/concert_admin_app/admin_app.py | 119 ++++++++++-------- .../concert_admin_app/admin_app_interface.py | 104 ++++++++------- .../src/rocon_remocon/interactive_client.py | 7 +- 3 files changed, 132 insertions(+), 98 deletions(-) diff --git a/concert_admin_app/src/concert_admin_app/admin_app.py b/concert_admin_app/src/concert_admin_app/admin_app.py index c44eb9b..b0364e9 100644 --- a/concert_admin_app/src/concert_admin_app/admin_app.py +++ b/concert_admin_app/src/concert_admin_app/admin_app.py @@ -6,20 +6,23 @@ ############################################################################## # Imports ############################################################################## -#system +# system from __future__ import division import os -#pyqt +# pyqt from python_qt_binding import loadUi -from python_qt_binding.QtCore import Qt, Signal, SIGNAL,SLOT +from python_qt_binding.QtCore import Qt, Signal, SIGNAL, SLOT from python_qt_binding.QtGui import QWidget, QTreeWidgetItem, QTextEdit, QPushButton, QPlainTextEdit, QGridLayout, QLabel -#ros +# ros import rospkg -#rqt +# rqt from qt_gui.plugin import Plugin import rocon_qt_library.utils as utils + from .admin_app_interface import AdminAppInterface +from rocon_python_comms.exceptions import NotFoundException + ############################################################################## # Admin App @@ -27,45 +30,52 @@ class AdminApp(Plugin): - _refresh_service_list_signal=Signal() + _refresh_service_list_signal = Signal() def __init__(self, context): - self._context=context + self._context = context super(AdminApp, self).__init__(context) - self.initialised=False + self.initialised = False self.setObjectName('Admin App') - self.is_setting_dlg_live=False; - self._widget=QWidget() + self.is_setting_dlg_live = False + self._widget = QWidget() - rospack=rospkg.RosPack() - ui_file=os.path.join(rospack.get_path('concert_admin_app'), 'ui', 'admin_app.ui') + + rospack = rospkg.RosPack() + ui_file = os.path.join(rospack.get_path('concert_admin_app'), 'ui', 'admin_app.ui') self._widget.setObjectName('AdminApphUi') loadUi(ui_file, self._widget, {}) - + if context.serial_number() > 1: self._widget.setWindowTitle(self._widget.windowTitle() + (' (%d)' % context.serial_number())) - - self.admin_app_interface = AdminAppInterface() - self.admin_app_interface._reg_event_callback(self._refresh_service) self.current_service = None self.params_layout = None self.params_layout_items = [] + self._init_admin_app_interface() self._init_event() self._init_widget() context.add_widget(self._widget) - + + def _init_admin_app_interface(self): + self.admin_app_interface = AdminAppInterface() + try: + self.admin_app_interface._init_admin_app_interface() + self.admin_app_interface._reg_event_callback(self._refresh_service) + except NotFoundException as e: + self.emit(SIGNAL("show_message"), self._widget, "Failed", e) + def _init_event(self): self._widget.enable_disable_btn.pressed.connect(self._toggle_service) self._widget.refresh_btn.pressed.connect(self._refresh_service) self._widget.save_configuration_btn.pressed.connect(self._save_parmeters) - self._widget.service_tree_widget.itemClicked.connect(self._select_service_tree_item) #concert item click event + self._widget.service_tree_widget.itemClicked.connect(self._select_service_tree_item) # concert item click event self._refresh_service_list_signal.connect(self._update_service_list) self.connect(self, SIGNAL("show_message"), utils.show_message) - + def _init_widget(self): self.params_layout = self._widget.findChildren(QGridLayout, "params_layout")[0] self.params_layout_items = [] @@ -85,8 +95,8 @@ def _save_parmeters(self): msg = "service is already enabled!" elif self.params_layout_items: for item in self.params_layout_items: - params[item[0].text()] = item[1].toPlainText().strip() - result = self.admin_app_interface.set_srv_parameters(params) + params[item[0].text()] = item[1].toPlainText().strip() + result = self.admin_app_interface.set_srv_parameters(self.current_service['name'], params) else: msg = "No params infomation" @@ -97,13 +107,18 @@ def _save_parmeters(self): def _toggle_service(self): if self.current_service['enabled']: - print "Disable Service: %s"%self.current_service['name'] - self.admin_app_interface.disable_service(self.current_service['name']) + print "Disable Service: %s" % self.current_service['name'] + (success, message) = self.admin_app_interface.disable_service(self.current_service['name']) self._set_enable_params_layout(True) else: - print "Enable Service: %s"%self.current_service['name'] - self.admin_app_interface.eable_service(self.current_service['name']) + print "Enable Service: %s" % self.current_service['name'] + (success, message) = self.admin_app_interface.eable_service(self.current_service['name']) self._set_enable_params_layout(False) + + if success: + self.emit(SIGNAL("show_message"), self._widget, "Success", message) + else: + self.emit(SIGNAL("show_message"), self._widget, "Failure", message) self.current_service = None self._widget.enable_disable_btn.setDisabled(True) @@ -111,41 +126,41 @@ def _toggle_service(self): def _refresh_service(self): self._refresh_service_list_signal.emit() - + def _update_service_list(self): self._widget.service_tree_widget.clear() self._widget.service_info_text.clear() self._widgetitem_service_pair = {} service_list = self.admin_app_interface.service_list - + for k in service_list.values(): - #Top service - service_item=QTreeWidgetItem(self._widget.service_tree_widget) - #service_item=QTreeWidgetItem() - service_item.setText (0, k['name']) - - #set Top Level Font - font=service_item.font(0) + # Top service + service_item = QTreeWidgetItem(self._widget.service_tree_widget) + # service_item=QTreeWidgetItem() + service_item.setText(0, k['name']) + + # set Top Level Font + font = service_item.font(0) font.setPointSize(20) font.setBold(True) - service_item.setFont(0,font) - + service_item.setFont(0, font) + self._widgetitem_service_pair[service_item] = k - - def _set_service_info(self,service_name): + + def _set_service_info(self, service_name): service_list = self.admin_app_interface.service_list self._widget.service_info_text.clear() self._widget.service_info_text.appendHtml(service_list[service_name]['context']) - - def _select_service_tree_item(self,item): + + def _select_service_tree_item(self, item): if item.parent() == None: selected_service = self._widgetitem_service_pair[item] - - print '_select_service: '+ selected_service['name'] + + print '_select_service: ' + selected_service['name'] self._set_service_info(selected_service['name']) self.current_service = selected_service self._set_parameter_layout() - + if self.current_service['enabled']: self._widget.enable_disable_btn.setText("Disable") self._widget.enable_disable_btn.setDisabled(False) @@ -154,10 +169,10 @@ def _select_service_tree_item(self,item): self._widget.enable_disable_btn.setDisabled(False) def _set_parameter_layout(self): - - params = self.admin_app_interface.get_srv_parameters(self.current_service['parameters']) + + params = self.admin_app_interface.get_srv_parameters(self.current_service['parameters_detail']) is_enabled = self.current_service['enabled'] - + if self.params_layout_items: for item in self.params_layout_items: self.params_layout.removeWidget(item[0]) @@ -165,15 +180,15 @@ def _set_parameter_layout(self): item[0].setParent(None) item[1].setParent(None) self.params_layout_items = [] - + if params: - self.params_layout.setColumnStretch (1, 0) - self.params_layout.setRowStretch (2, 0) + self.params_layout.setColumnStretch(1, 0) + self.params_layout.setRowStretch(2, 0) for param in params.keys(): - label = QLabel(param) + label = QLabel(param) self.params_layout.addWidget(label) value = QTextEdit(str(params[param])) - value.setMaximumHeight(30) + value.setMaximumHeight(30) self.params_layout.addWidget(value) self.params_layout_items.append((label, value)) @@ -185,5 +200,3 @@ def _set_enable_params_layout(self, enable): for item in self.params_layout_items: item[0].setEnabled(enable) item[1].setEnabled(enable) - - diff --git a/concert_admin_app/src/concert_admin_app/admin_app_interface.py b/concert_admin_app/src/concert_admin_app/admin_app_interface.py index e4b26be..a355a7b 100644 --- a/concert_admin_app/src/concert_admin_app/admin_app_interface.py +++ b/concert_admin_app/src/concert_admin_app/admin_app_interface.py @@ -3,75 +3,94 @@ # License: BSD # https://raw.github.com/robotics-in-concert/rocon_qt_gui/license/LICENSE # -import yaml import rospy -import rocon_python_utils +import rocon_python_comms + import concert_msgs.msg as concert_msgs +import rocon_std_msgs.msg as rocon_std_msgs + from concert_msgs.srv import EnableService +from concert_msgs.srv import UpdateServiceConfig +from rocon_python_comms.exceptions import NotFoundException ############################################################################## # Graph ############################################################################## class AdminAppInterface(object): + def __init__(self): self._event_callback = None - self.full_params_path = "" + self.full_params_path = "" self.service_list = {} - # should make use of concert_msgs/Strings here. - rospy.Subscriber("concert/services/list", concert_msgs.Services, self.update_service_list) + self.ros_subscribers = {} + self.ros_services = {} + + + def _init_admin_app_interface(self): + self._init_ros_subscriber() + self._init_ros_service() + + def _init_ros_subscriber(self): + try: + subscriber_topic_name = rocon_python_comms.find_topic('concert_msgs/Services', timeout=rospy.rostime.Duration(5.0), unique=True) + self.ros_subscribers['service_list'] = rospy.Subscriber(subscriber_topic_name, concert_msgs.Services, self.update_service_list) + except NotFoundException as e: + raise e + + def _init_ros_service(self): + try: + enable_service = rocon_python_comms.find_service('concert_msgs/EnableService', timeout=rospy.rostime.Duration(5.0), unique=True) + self.ros_services['enable_service'] = rospy.ServiceProxy(enable_service, EnableService) + update_service_config = rocon_python_comms.find_service('concert_msgs/UpdateServiceConfig', timeout=rospy.rostime.Duration(5.0), unique=True) + self.ros_services['update_service_config'] = rospy.ServiceProxy(update_service_config, UpdateServiceConfig) + except NotFoundException as e: + raise e def _reg_event_callback(self, func): self._event_callback = func - def eable_service(self, srv_name): - service = "/concert/services/enable" - service_handle=rospy.ServiceProxy(service, EnableService) - call_result=service_handle(srv_name,True) - print call_result - + # todo + call_result = self.ros_services['enable_service'](srv_name, True) + return call_result.success, call_result.error_message def disable_service(self, srv_name): - service = "/concert/services/enable" - service_handle=rospy.ServiceProxy(service, EnableService) - call_result=service_handle(srv_name,False) - print call_result + # todo + call_result = self.ros_services['enable_service'](srv_name, False) + return call_result.success, call_result.error_message - def get_srv_parameters(self, parameters_path): + def update_service_config(self, srv_profile): + # todo + call_result = self.ros_services['update_service_config'](srv_profile) + return call_result.success, call_result.error_message + + def get_srv_parameters(self, parameters_detail): params = None - if parameters_path: - self.full_params_path = rocon_python_utils.ros.resources.find_resource_from_string(parameters_path+".parameters") - try: - stream = open(self.full_params_path, 'r') - params = yaml.load(stream) - - except Exception, e: - rospy.loginfo(e) - else: - return params - - def set_srv_parameters(self, data): + params = {} + for param in parameters_detail: + params[param.key] = param.value + return params + + def set_srv_parameters(self, srv_name, param_data): try: - if not self.full_params_path: - return False - if not data: - return False - stream = open(self.full_params_path, 'r') - bak_data = yaml.load(stream) - bak_stream = file(self.full_params_path+'.bak', 'w') - yaml.safe_dump(bak_data, bak_stream, default_flow_style=False) - new_stream = file(self.full_params_path, 'w') - yaml.safe_dump(data, new_stream, default_flow_style=False) + srv_profile_msg = concert_msgs.ServiceProfile() + srv_profile_msg.name = srv_name + parameter_detail = [] + for key in param_data.keys(): + parameter = rocon_std_msgs.KeyValue(key, param_data[key]) + parameter_detail.append(parameter) + srv_profile_msg.parameters_detail = parameter_detail + self.update_service_config(srv_profile_msg) except Exception, e: rospy.loginfo(e) return False else: return True - + def update_service_list(self, data): - + self.service_list = {} for k in data.services: service_name = k.name @@ -86,14 +105,15 @@ def update_service_list(self, data): self.service_list[service_name]['launcher'] = k.launcher self.service_list[service_name]['interactions'] = k.interactions self.service_list[service_name]['parameters'] = k.parameters + self.service_list[service_name]['parameters_detail'] = k.parameters_detail self.service_list[service_name]['uuid'] = k.uuid self.service_list[service_name]['status'] = k.status self.service_list[service_name]['enabled'] = k.enabled - #html + # html service_context = "" for key in self.service_list[service_name].keys(): - service_context += "

"+key+": " + str(self.service_list[service_name][key]) + "

" + service_context += "

" + key + ": " + str(self.service_list[service_name][key]) + "

" service_context += "" self.service_list[service_name]['context'] = service_context diff --git a/rocon_remocon/src/rocon_remocon/interactive_client.py b/rocon_remocon/src/rocon_remocon/interactive_client.py index a3c7840..68aed93 100644 --- a/rocon_remocon/src/rocon_remocon/interactive_client.py +++ b/rocon_remocon/src/rocon_remocon/interactive_client.py @@ -294,15 +294,16 @@ def _start_roslaunch_interaction(self, interaction, roslaunch_filename): launch_configuration = rocon_launch.RosLaunchConfiguration( name=roslaunch_filename, package=None, - port=self._ros_master_port, + #port=self._ros_master_port, + port=11314, title=interaction.display_name, namespace=interaction.namespace, args=self._prepare_roslaunch_args(interaction.parameters), options="--screen" ) env = {} - env['ROS_MASTER_URI'] = self.ros_master_uri - env['ROS_HOSTNAME'] = self.host_name + #env['ROS_MASTER_URI'] = "http://192.168.10.35:11314" + #env['ROS_HOSTNAME'] = self.host_name process_listener = partial(self._process_listeners, anonymous_name, 1) (process, meta_roslauncher) = self._roslaunch_terminal.spawn_roslaunch_window(launch_configuration, postexec_fn=process_listener, env = env) From 4f6628a4b7c8de9e31870305d4c093fec102ee5e Mon Sep 17 00:00:00 2001 From: dwlee Date: Mon, 19 Jan 2015 14:01:04 +0900 Subject: [PATCH 3/4] restore rocon_remocon src --- .../src/rocon_remocon/interactive_client.py | 20 ++----------------- 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/rocon_remocon/src/rocon_remocon/interactive_client.py b/rocon_remocon/src/rocon_remocon/interactive_client.py index 68aed93..b36da36 100644 --- a/rocon_remocon/src/rocon_remocon/interactive_client.py +++ b/rocon_remocon/src/rocon_remocon/interactive_client.py @@ -86,17 +86,12 @@ def __init__(self, stop_interaction_postexec_fn): # expose underlying functionality higher up self.interactions = self._interactions_table.generate_role_view """Get a dictionary of interactions belonging to the specified role.""" - self.ros_master_uri = "" - self.host_name = "" def _connect(self, rocon_master_name="", ros_master_uri="http://localhost:11311", host_name='localhost'): # uri is obtained from the user, stored in ros_master_uri os.environ["ROS_MASTER_URI"] = ros_master_uri os.environ["ROS_HOSTNAME"] = host_name - self.ros_master_uri = ros_master_uri - self.host_name = host_name - self._ros_master_port = urlparse(os.environ["ROS_MASTER_URI"]).port console.logdebug("Interactive Client : Connection Details") @@ -109,11 +104,8 @@ def _connect(self, rocon_master_name="", ros_master_uri="http://localhost:11311" # for the remocon-role manager interaction anyway: rospy.init_node(self.name, disable_signals=True) try: - print "get_interactions_service_name" get_interactions_service_name = rocon_python_comms.find_service('rocon_interaction_msgs/GetInteractions', timeout=rospy.rostime.Duration(5.0), unique=True) - print "get_roles_service_name" get_roles_service_name = rocon_python_comms.find_service('rocon_interaction_msgs/GetRoles', timeout=rospy.rostime.Duration(5.0), unique=True) - print "request_interaction_service_name" request_interaction_service_name = rocon_python_comms.find_service('rocon_interaction_msgs/RequestInteraction', timeout=rospy.rostime.Duration(5.0), unique=True) except rocon_python_comms.NotFoundException as e: message = "failed to find all of the interactions' publications and services [%s]" % str(e) @@ -127,16 +119,13 @@ def _connect(self, rocon_master_name="", ros_master_uri="http://localhost:11311" try: # if its available, should be quick to find this one since we found the others... - print "pairing_topic_name" pairing_topic_name = rocon_python_comms.find_topic('rocon_interaction_msgs/Pair', timeout=rospy.rostime.Duration(0.5), unique=True) - self.pairing_status_subscriber = rospy.Subscriber(pairing_topic_name, rocon_interaction_msgs.Pair, self._subscribe_pairing_status_callback) except rocon_python_comms.NotFoundException as e: console.logdebug("Interactive Client : support for paired interactions disabled [not found]") self._publish_remocon_status() self.is_connect = True - print "Connecting!!!" return (True, "success") def shutdown(self): @@ -294,19 +283,14 @@ def _start_roslaunch_interaction(self, interaction, roslaunch_filename): launch_configuration = rocon_launch.RosLaunchConfiguration( name=roslaunch_filename, package=None, - #port=self._ros_master_port, - port=11314, + port=self._ros_master_port, title=interaction.display_name, namespace=interaction.namespace, args=self._prepare_roslaunch_args(interaction.parameters), options="--screen" ) - env = {} - #env['ROS_MASTER_URI'] = "http://192.168.10.35:11314" - #env['ROS_HOSTNAME'] = self.host_name - process_listener = partial(self._process_listeners, anonymous_name, 1) - (process, meta_roslauncher) = self._roslaunch_terminal.spawn_roslaunch_window(launch_configuration, postexec_fn=process_listener, env = env) + (process, meta_roslauncher) = self._roslaunch_terminal.spawn_roslaunch_window(launch_configuration, postexec_fn=process_listener) interaction.launch_list[anonymous_name] = RosLaunchInfo(anonymous_name, True, process, self._roslaunch_terminal.shutdown_roslaunch_windows, [meta_roslauncher]) return True From 1a13f9da044abdf11b1f28140a2befd3c5b976a0 Mon Sep 17 00:00:00 2001 From: dwlee Date: Tue, 20 Jan 2015 16:04:13 +0900 Subject: [PATCH 4/4] fix return value regarding service profile update function --- .../src/concert_admin_app/admin_app_interface.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/concert_admin_app/src/concert_admin_app/admin_app_interface.py b/concert_admin_app/src/concert_admin_app/admin_app_interface.py index a355a7b..8e946a9 100644 --- a/concert_admin_app/src/concert_admin_app/admin_app_interface.py +++ b/concert_admin_app/src/concert_admin_app/admin_app_interface.py @@ -26,8 +26,7 @@ def __init__(self): self.service_list = {} self.ros_subscribers = {} self.ros_services = {} - - + def _init_admin_app_interface(self): self._init_ros_subscriber() self._init_ros_service() @@ -42,7 +41,7 @@ def _init_ros_subscriber(self): def _init_ros_service(self): try: enable_service = rocon_python_comms.find_service('concert_msgs/EnableService', timeout=rospy.rostime.Duration(5.0), unique=True) - self.ros_services['enable_service'] = rospy.ServiceProxy(enable_service, EnableService) + self.ros_services['enable_service'] = rospy.ServiceProxy(enable_service, EnableService) update_service_config = rocon_python_comms.find_service('concert_msgs/UpdateServiceConfig', timeout=rospy.rostime.Duration(5.0), unique=True) self.ros_services['update_service_config'] = rospy.ServiceProxy(update_service_config, UpdateServiceConfig) except NotFoundException as e: @@ -74,6 +73,7 @@ def get_srv_parameters(self, parameters_detail): return params def set_srv_parameters(self, srv_name, param_data): + result = False try: srv_profile_msg = concert_msgs.ServiceProfile() srv_profile_msg.name = srv_name @@ -82,12 +82,12 @@ def set_srv_parameters(self, srv_name, param_data): parameter = rocon_std_msgs.KeyValue(key, param_data[key]) parameter_detail.append(parameter) srv_profile_msg.parameters_detail = parameter_detail - self.update_service_config(srv_profile_msg) + result = self.update_service_config(srv_profile_msg) except Exception, e: rospy.loginfo(e) - return False - else: - return True + result = False + + return result def update_service_list(self, data):