Commit 82c30121 authored by Aurélien Delrieu's avatar Aurélien Delrieu

Merge branch 'fix_manager' into dev

parents 9f6b06a3 e49a7851
......@@ -10,7 +10,7 @@ After=systemd-journald-dev-log.socket
Type=forking
ExecStart=/bin/bash -c " SAND_COLLECTOR_TYPE=`echo 'get opensand-collector/service/type' | debconf-communicate | awk '{print $2}'` && \
SAND_COLLECTOR_IFACE=`echo 'get opensand-collector/service/interface' | debconf-communicate | awk '{print $2}'` && \
/usr/bin/sand-collector -i $SAND_COLLECTOR_IFACE -t $SAND_COLLECTOR_TYPE & "
/usr/bin/sand-collector -i $SAND_COLLECTOR_IFACE -t \"$SAND_COLLECTOR_TYPE\" & "
ExecStartPre=/bin/bash -c "mkdir -p /var/run/sand-collector && chown opensand /var/run/sand-collector"
[Install]
......
......@@ -50,6 +50,7 @@ import sys
LOGGER = logging.getLogger('sand-collector')
DEFAULT_SERVICE_TYPE = '_opensand._tcp'
def fail(message, *args):
......@@ -99,9 +100,9 @@ class OpenSandCollector(object):
"""
parser = OptionParser()
parser.set_defaults(debug=False, background=False, kill=False)
parser.add_option("-t", "--service_type", dest="service_type",
default='_opensand._tcp', action="store",
help="OpenSAND service type (default: _opensand._tcp)")
parser.add_option("-t", "--platform-id", dest="platform_id",
default='', action="store",
help="OpenSAND platform name")
parser.add_option("-i", "--iface", dest="iface",
default='', action="store",
help="Interface for service publishing (default: all)")
......@@ -123,10 +124,16 @@ class OpenSandCollector(object):
help="Kill a background collector instance")
(options, _args) = parser.parse_args()
service_type = options.service_type
platform_id = options.platform_id
iface = options.iface
pid_path = options.pid
# Service type
service_type = (
'_%s%s' % (platform_id, DEFAULT_SERVICE_TYPE) if platform_id
else DEFAULT_SERVICE_TYPE
)
# Logging configuration
if options.background or options.quiet:
log_handler = SysLogHandler('sand-collector', syslog.LOG_PID,
......
......@@ -448,6 +448,7 @@
<![CDATA[
<b>\tSatellite delay configuration</b>
]]>
<xpath common.global_constant_delay="false" />
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
......@@ -465,7 +466,7 @@
<xsd:documentation xml:lang="en">
Satellite delay refresh period (ms)
<unit>ms</unit>
<adv>true</adv>
<xpath common.global_constant_delay="false" />
</xsd:documentation>
</xsd:annotation>
</xsd:element>
......
......@@ -416,6 +416,7 @@
<![CDATA[
<b>\tSatellite delay configuration</b>
]]>
<xpath common.global_constant_delay="false" />
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
......@@ -433,7 +434,7 @@
<xsd:documentation xml:lang="en">
Satellite delay refresh period (ms)
<unit>ms</unit>
<adv>true</adv>
<xpath common.global_constant_delay="false" />
</xsd:documentation>
</xsd:annotation>
</xsd:element>
......
......@@ -71,6 +71,7 @@ CONF_PARSER = None
INTERFACES = None
DEFAULT_CACHE='/var/cache/sand-daemon'
DEFAULT_SERVICE_TYPE='_opensand._tcp'
PLATFORM_ID='OPENSAND_PLATFORM_ID'
def sig_handler(signum, frame):
......@@ -119,7 +120,8 @@ def publish_service(output_handler):
# get configuration
name = ''
service_type = '_opensand._tcp'
service_type = ''
platform_id = ''
port = ''
instance = ''
tools = ''
......@@ -128,7 +130,7 @@ def publish_service(output_handler):
name = CONF_PARSER.get('service', 'name')
port = CONF_PARSER.getint('service', 'port')
if CONF_PARSER.has_option('service', 'type'):
service_type = CONF_PARSER.get('service', 'type')
platform_id = CONF_PARSER.get('service', 'type')
# the port of each server
state = CONF_PARSER.getint('state', 'port')
command = CONF_PARSER.getint('command', 'port')
......@@ -145,13 +147,11 @@ def publish_service(output_handler):
LOGGER.error("unable to parse configuration file: " + str(error))
thread.exit()
# export the service name
try:
platform_id = re.findall('_(.*)_opensand._tcp', service_type)[0]
except IndexError:
pass
else:
os.environ[PLATFORM_ID] = platform_id
os.environ[PLATFORM_ID] = platform_id
service_type = (
'_%s%s' % (platform_id, DEFAULT_SERVICE_TYPE) if platform_id
else DEFAULT_SERVICE_TYPE
)
# get the interfaces data
descr.update(INTERFACES.get_descr())
......
......@@ -478,6 +478,7 @@ class ResourceView(WindowView):
nb_tal_scpc += 1
expand_rate = gtk.Expander(label = (label_gr + label_st))
expand_rate.set_expanded(True)
expand_rate.set_use_markup(True)
carrier_rate = "";
carrier_arithmetic = None
......
......@@ -48,6 +48,8 @@ from opensand_manager_core.env_plane_dispatcher import EnvPlaneDispatcher
from opensand_manager_gui.opensand_view import View
from opensand_manager_gui.view.popup.infos import error_popup
DEFAULT_SERVICE_TYPE = '_opensand._tcp'
# TODO add option load plugin from another directory if it is possible ?
# TODO replace optparser by argparse if 2.6 support is abandonned
class OpenSandManager:
......@@ -81,8 +83,8 @@ class OpenSandManager:
help="use the specified glade file to load UI")
opt_parser.add_option("-s", "--scenario", dest="scenario", default='',
help="open or create the specified scenario")
opt_parser.add_option("-t", "--service-type", dest="service_type",
default='_opensand._tcp',
opt_parser.add_option("-t", "--platform-id", dest="platform_id",
default='',
help="listen for OpenSAND entities on the \
specified service type with format: \
_name._transport_protocol")
......@@ -100,6 +102,12 @@ class OpenSandManager:
(options, args) = opt_parser.parse_args()
### format the service type
service_type = (
'_%s%s' % (options.platform_id, DEFAULT_SERVICE_TYPE)
if options.platform_id else DEFAULT_SERVICE_TYPE
)
### create the logger
# Create the log View that logs manager events in main window
......@@ -119,10 +127,10 @@ class OpenSandManager:
self._view = View(self._model, self._manager_log,
options.glade, options.dev_mode,
options.adv_mode,
options.service_type)
service_type)
# create the host controller and response manager
self._controller = Controller(self._model, options.service_type,
self._controller = Controller(self._model, service_type,
self._manager_log, options.interactive)
EnvPlaneDispatcher(self._controller.get_env_plane_controller(),
......
......@@ -61,11 +61,11 @@ if __name__ == '__main__':
arg_parser.add_argument("-w", "--enable_ws", action="store_true",
dest="ws", default=False,
help="enable verbose mode (print OpenSAND status)")
arg_parser.add_argument("-s", "--service", dest="service",
default=SERVICE,
arg_parser.add_argument("-s", "--platform-id", dest="platform_id",
default='',
help="listen for OpenSAND entities "\
"on the specified service type with format: " \
"_name._transport_protocol")
"_{platform_id}_opensand._tcp")
arg_parser.add_argument("-p", "--port", dest="port",
default=5656,
help="the port to listen for user connection")
......@@ -89,9 +89,15 @@ if __name__ == '__main__':
MGR = ShellManager()
# format service type
service = (
"_%s%s" % (options.platform_id, SERVICE) if options.platform_id
else SERVICE
)
print 'Listening on port %s' % options.port
try:
MGR.load(log_level=lvl, service=options.service, with_ws=options.ws,
MGR.load(log_level=lvl, service=service, with_ws=options.ws,
command_server=(True, int(options.port)))
except KeyboardInterrupt:
print 'Exiting...'
......
Template: opensand-collector/service/type
Type: string
Default: _opensand._tcp
Description: Service type
Select the type of service with format:
_name._transport_protocol
All the hosts from the same platfrom MUST have the same service type
Description: Platform ID
Select the ID of the platform (leave empty by default). This name will be
used to form the zeroconf service type (_{platform_id}_opensand._tcp).
No spaces or special characters are admitted.
All the hosts from the same platform MUST have the same platform ID.
Template: opensand-collector/service/interface
Type: select
......
......@@ -10,11 +10,11 @@ Description: Do you want to use the default configuration ?
Template: opensand-daemon/service/type
Type: string
Default: _opensand._tcp
Description: Service type
Select the type of service with format:
_name._transport_protocol
All the hosts from the same platform MUST have the same service type
Description: Platform ID
Select the ID of the platform (leave empty by default). This name will be
used to form the zeroconf service type (_{platform_id}_opensand._tcp).
No spaces or special characters are admitted.
All the hosts from the same platform MUST have the same platform ID.
Template: opensand-daemon/service/name
Type: select
......
Template: opensand-collector/service/type
Type: string
Default: _opensand._tcp
Description: Service type
Select the type of service with format:
_name._transport_protocol
All the hosts from the same platfrom MUST have the same service type
Description: Platform ID
Select the ID of the platform (leave empty by default). This name will be
used to form the zeroconf service type (_{platform_id}_opensand._tcp).
No spaces or special characters are admitted.
All the hosts from the same platform MUST have the same platform ID.
Template: opensand-collector/service/interface
Type: select
......
......@@ -10,11 +10,11 @@ Description: Do you want to use the default configuration ?
Template: opensand-daemon/service/type
Type: string
Default: _opensand._tcp
Description: Service type
Select the type of service with format:
_name._transport_protocol
All the hosts from the same platform MUST have the same service type
Description: Platform ID
Select the ID of the platform (leave empty by default). This name will be
used to form the zeroconf service type (_{platform_id}_opensand._tcp).
No spaces or special characters are admitted.
All the hosts from the same platform MUST have the same platform ID.
Template: opensand-daemon/service/name
Type: select
......
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