#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# @author: Girish Moodalbail, Oracle, Inc.
OPTS = [
]
"""Driver used to manage Solaris EVS VNICs.
"""
# TODO(gmoodalb): dnsmasq uses old style `ifreq', so 16 is the maximum
# length including the NUL character. If we change it to use new style
# `lifreq', then we will be able to extend the length to 32 characters.
# Since there is no connect_uri() yet, we need to do this ourselves
# parse ssh://user@hostname
raise SystemExit(_("Specified evs_controller is invalid"))
raise SystemExit(_("'user' and 'hostname' need to be specified "
"for evs_controller"))
# save the user and EVS controller info
self._rad_connection = None
# set the controller property for this host
'controller']
if (self._rad_connection is not None and
return self._rad_connection
return self._rad_connection
"""Set the L3 settings for the interface using data from the port.
"""
if addrconf:
# TODO(gmoodalb): - probably take PREFIX?? for L3
"""Plug in the interface."""
try:
if vports_info:
# will end up in "vport in use" error. So, we need to reset the
# vport before we connect the VNIC to EVS.
'tenant': tenant_id})
pat)
if evs_objs:
if not protection:
'tenant': tenant_id,
'evsuuid': network_id})
if vport_objs:
finally:
"""Unplug the interface."""