repo
stringlengths
7
55
path
stringlengths
4
127
func_name
stringlengths
1
88
original_string
stringlengths
75
19.8k
language
stringclasses
1 value
code
stringlengths
75
19.8k
code_tokens
list
docstring
stringlengths
3
17.3k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
87
242
partition
stringclasses
1 value
Robpol86/sphinxcontrib-versioning
sphinxcontrib/versioning/sphinx_.py
EventHandlers.builder_inited
def builder_inited(app): """Update the Sphinx builder. :param sphinx.application.Sphinx app: Sphinx application object. """ # Add this extension's _templates directory to Sphinx. templates_dir = os.path.join(os.path.dirname(__file__), '_templates') app.builder.templates....
python
def builder_inited(app): """Update the Sphinx builder. :param sphinx.application.Sphinx app: Sphinx application object. """ # Add this extension's _templates directory to Sphinx. templates_dir = os.path.join(os.path.dirname(__file__), '_templates') app.builder.templates....
[ "def", "builder_inited", "(", "app", ")", ":", "templates_dir", "=", "os", ".", "path", ".", "join", "(", "os", ".", "path", ".", "dirname", "(", "__file__", ")", ",", "'_templates'", ")", "app", ".", "builder", ".", "templates", ".", "pathchain", ".",...
Update the Sphinx builder. :param sphinx.application.Sphinx app: Sphinx application object.
[ "Update", "the", "Sphinx", "builder", "." ]
920edec0ac764081b583a2ecf4e6952762b9dbf2
https://github.com/Robpol86/sphinxcontrib-versioning/blob/920edec0ac764081b583a2ecf4e6952762b9dbf2/sphinxcontrib/versioning/sphinx_.py#L47-L62
train
Robpol86/sphinxcontrib-versioning
sphinxcontrib/versioning/sphinx_.py
EventHandlers.env_updated
def env_updated(cls, app, env): """Abort Sphinx after initializing config and discovering all pages to build. :param sphinx.application.Sphinx app: Sphinx application object. :param sphinx.environment.BuildEnvironment env: Sphinx build environment. """ if cls.ABORT_AFTER_READ: ...
python
def env_updated(cls, app, env): """Abort Sphinx after initializing config and discovering all pages to build. :param sphinx.application.Sphinx app: Sphinx application object. :param sphinx.environment.BuildEnvironment env: Sphinx build environment. """ if cls.ABORT_AFTER_READ: ...
[ "def", "env_updated", "(", "cls", ",", "app", ",", "env", ")", ":", "if", "cls", ".", "ABORT_AFTER_READ", ":", "config", "=", "{", "n", ":", "getattr", "(", "app", ".", "config", ",", "n", ")", "for", "n", "in", "(", "a", "for", "a", "in", "dir...
Abort Sphinx after initializing config and discovering all pages to build. :param sphinx.application.Sphinx app: Sphinx application object. :param sphinx.environment.BuildEnvironment env: Sphinx build environment.
[ "Abort", "Sphinx", "after", "initializing", "config", "and", "discovering", "all", "pages", "to", "build", "." ]
920edec0ac764081b583a2ecf4e6952762b9dbf2
https://github.com/Robpol86/sphinxcontrib-versioning/blob/920edec0ac764081b583a2ecf4e6952762b9dbf2/sphinxcontrib/versioning/sphinx_.py#L65-L76
train
Robpol86/sphinxcontrib-versioning
sphinxcontrib/versioning/sphinx_.py
EventHandlers.html_page_context
def html_page_context(cls, app, pagename, templatename, context, doctree): """Update the Jinja2 HTML context, exposes the Versions class instance to it. :param sphinx.application.Sphinx app: Sphinx application object. :param str pagename: Name of the page being rendered (without .html or any fi...
python
def html_page_context(cls, app, pagename, templatename, context, doctree): """Update the Jinja2 HTML context, exposes the Versions class instance to it. :param sphinx.application.Sphinx app: Sphinx application object. :param str pagename: Name of the page being rendered (without .html or any fi...
[ "def", "html_page_context", "(", "cls", ",", "app", ",", "pagename", ",", "templatename", ",", "context", ",", "doctree", ")", ":", "assert", "templatename", "or", "doctree", "cls", ".", "VERSIONS", ".", "context", "=", "context", "versions", "=", "cls", "...
Update the Jinja2 HTML context, exposes the Versions class instance to it. :param sphinx.application.Sphinx app: Sphinx application object. :param str pagename: Name of the page being rendered (without .html or any file extension). :param str templatename: Page name with .html. :param d...
[ "Update", "the", "Jinja2", "HTML", "context", "exposes", "the", "Versions", "class", "instance", "to", "it", "." ]
920edec0ac764081b583a2ecf4e6952762b9dbf2
https://github.com/Robpol86/sphinxcontrib-versioning/blob/920edec0ac764081b583a2ecf4e6952762b9dbf2/sphinxcontrib/versioning/sphinx_.py#L79-L134
train
Robpol86/sphinxcontrib-versioning
sphinxcontrib/versioning/__main__.py
cli
def cli(config, **options): """Build versioned Sphinx docs for every branch and tag pushed to origin. Supports only building locally with the "build" sub command or build and push to a remote with the "push" sub command. For more information for either run them with their own --help. The options below...
python
def cli(config, **options): """Build versioned Sphinx docs for every branch and tag pushed to origin. Supports only building locally with the "build" sub command or build and push to a remote with the "push" sub command. For more information for either run them with their own --help. The options below...
[ "def", "cli", "(", "config", ",", "**", "options", ")", ":", "def", "pre", "(", "rel_source", ")", ":", "if", "not", "NO_EXECUTE", ":", "setup_logging", "(", "verbose", "=", "config", ".", "verbose", ",", "colors", "=", "not", "config", ".", "no_colors...
Build versioned Sphinx docs for every branch and tag pushed to origin. Supports only building locally with the "build" sub command or build and push to a remote with the "push" sub command. For more information for either run them with their own --help. The options below are global and must be specified b...
[ "Build", "versioned", "Sphinx", "docs", "for", "every", "branch", "and", "tag", "pushed", "to", "origin", "." ]
920edec0ac764081b583a2ecf4e6952762b9dbf2
https://github.com/Robpol86/sphinxcontrib-versioning/blob/920edec0ac764081b583a2ecf4e6952762b9dbf2/sphinxcontrib/versioning/__main__.py#L121-L173
train
Robpol86/sphinxcontrib-versioning
sphinxcontrib/versioning/__main__.py
build_options
def build_options(func): """Add "build" Click options to function. :param function func: The function to wrap. :return: The wrapped function. :rtype: function """ func = click.option('-a', '--banner-greatest-tag', is_flag=True, help='Override banner-main-ref to be the t...
python
def build_options(func): """Add "build" Click options to function. :param function func: The function to wrap. :return: The wrapped function. :rtype: function """ func = click.option('-a', '--banner-greatest-tag', is_flag=True, help='Override banner-main-ref to be the t...
[ "def", "build_options", "(", "func", ")", ":", "func", "=", "click", ".", "option", "(", "'-a'", ",", "'--banner-greatest-tag'", ",", "is_flag", "=", "True", ",", "help", "=", "'Override banner-main-ref to be the tag with the highest version number.'", ")", "(", "fu...
Add "build" Click options to function. :param function func: The function to wrap. :return: The wrapped function. :rtype: function
[ "Add", "build", "Click", "options", "to", "function", "." ]
920edec0ac764081b583a2ecf4e6952762b9dbf2
https://github.com/Robpol86/sphinxcontrib-versioning/blob/920edec0ac764081b583a2ecf4e6952762b9dbf2/sphinxcontrib/versioning/__main__.py#L176-L207
train
Robpol86/sphinxcontrib-versioning
sphinxcontrib/versioning/__main__.py
override_root_main_ref
def override_root_main_ref(config, remotes, banner): """Override root_ref or banner_main_ref with tags in config if user requested. :param sphinxcontrib.versioning.lib.Config config: Runtime configuration. :param iter remotes: List of dicts from Versions.remotes. :param bool banner: Evaluate banner mai...
python
def override_root_main_ref(config, remotes, banner): """Override root_ref or banner_main_ref with tags in config if user requested. :param sphinxcontrib.versioning.lib.Config config: Runtime configuration. :param iter remotes: List of dicts from Versions.remotes. :param bool banner: Evaluate banner mai...
[ "def", "override_root_main_ref", "(", "config", ",", "remotes", ",", "banner", ")", ":", "log", "=", "logging", ".", "getLogger", "(", "__name__", ")", "greatest_tag", "=", "config", ".", "banner_greatest_tag", "if", "banner", "else", "config", ".", "greatest_...
Override root_ref or banner_main_ref with tags in config if user requested. :param sphinxcontrib.versioning.lib.Config config: Runtime configuration. :param iter remotes: List of dicts from Versions.remotes. :param bool banner: Evaluate banner main ref instead of root ref. :return: If root/main ref ex...
[ "Override", "root_ref", "or", "banner_main_ref", "with", "tags", "in", "config", "if", "user", "requested", "." ]
920edec0ac764081b583a2ecf4e6952762b9dbf2
https://github.com/Robpol86/sphinxcontrib-versioning/blob/920edec0ac764081b583a2ecf4e6952762b9dbf2/sphinxcontrib/versioning/__main__.py#L210-L234
train
Robpol86/sphinxcontrib-versioning
sphinxcontrib/versioning/__main__.py
push
def push(ctx, config, rel_source, dest_branch, rel_dest, **options): """Build locally and then push to remote branch. First the build sub command is invoked which takes care of building all versions of your documentation in a temporary directory. If that succeeds then all built documents will be pushed to ...
python
def push(ctx, config, rel_source, dest_branch, rel_dest, **options): """Build locally and then push to remote branch. First the build sub command is invoked which takes care of building all versions of your documentation in a temporary directory. If that succeeds then all built documents will be pushed to ...
[ "def", "push", "(", "ctx", ",", "config", ",", "rel_source", ",", "dest_branch", ",", "rel_dest", ",", "**", "options", ")", ":", "if", "'pre'", "in", "config", ":", "config", ".", "pop", "(", "'pre'", ")", "(", "rel_source", ")", "config", ".", "upd...
Build locally and then push to remote branch. First the build sub command is invoked which takes care of building all versions of your documentation in a temporary directory. If that succeeds then all built documents will be pushed to a remote branch. REL_SOURCE is the path to the docs directory relative ...
[ "Build", "locally", "and", "then", "push", "to", "remote", "branch", "." ]
920edec0ac764081b583a2ecf4e6952762b9dbf2
https://github.com/Robpol86/sphinxcontrib-versioning/blob/920edec0ac764081b583a2ecf4e6952762b9dbf2/sphinxcontrib/versioning/__main__.py#L332-L395
train
Robpol86/sphinxcontrib-versioning
sphinxcontrib/versioning/__main__.py
ClickGroup.get_params
def get_params(self, ctx): """Sort order of options before displaying. :param click.core.Context ctx: Click context. :return: super() return value. """ self.params.sort(key=self.custom_sort) return super(ClickGroup, self).get_params(ctx)
python
def get_params(self, ctx): """Sort order of options before displaying. :param click.core.Context ctx: Click context. :return: super() return value. """ self.params.sort(key=self.custom_sort) return super(ClickGroup, self).get_params(ctx)
[ "def", "get_params", "(", "self", ",", "ctx", ")", ":", "self", ".", "params", ".", "sort", "(", "key", "=", "self", ".", "custom_sort", ")", "return", "super", "(", "ClickGroup", ",", "self", ")", ".", "get_params", "(", "ctx", ")" ]
Sort order of options before displaying. :param click.core.Context ctx: Click context. :return: super() return value.
[ "Sort", "order", "of", "options", "before", "displaying", "." ]
920edec0ac764081b583a2ecf4e6952762b9dbf2
https://github.com/Robpol86/sphinxcontrib-versioning/blob/920edec0ac764081b583a2ecf4e6952762b9dbf2/sphinxcontrib/versioning/__main__.py#L54-L62
train
Robpol86/sphinxcontrib-versioning
sphinxcontrib/versioning/__main__.py
ClickGroup.main
def main(self, *args, **kwargs): """Main function called by setuptools. :param list args: Passed to super(). :param dict kwargs: Passed to super(). :return: super() return value. """ argv = kwargs.pop('args', click.get_os_args()) if '--' in argv: pos...
python
def main(self, *args, **kwargs): """Main function called by setuptools. :param list args: Passed to super(). :param dict kwargs: Passed to super(). :return: super() return value. """ argv = kwargs.pop('args', click.get_os_args()) if '--' in argv: pos...
[ "def", "main", "(", "self", ",", "*", "args", ",", "**", "kwargs", ")", ":", "argv", "=", "kwargs", ".", "pop", "(", "'args'", ",", "click", ".", "get_os_args", "(", ")", ")", "if", "'--'", "in", "argv", ":", "pos", "=", "argv", ".", "index", "...
Main function called by setuptools. :param list args: Passed to super(). :param dict kwargs: Passed to super(). :return: super() return value.
[ "Main", "function", "called", "by", "setuptools", "." ]
920edec0ac764081b583a2ecf4e6952762b9dbf2
https://github.com/Robpol86/sphinxcontrib-versioning/blob/920edec0ac764081b583a2ecf4e6952762b9dbf2/sphinxcontrib/versioning/__main__.py#L64-L78
train
Robpol86/sphinxcontrib-versioning
sphinxcontrib/versioning/__main__.py
ClickGroup.invoke
def invoke(self, ctx): """Inject overflow arguments into context state. :param click.core.Context ctx: Click context. :return: super() return value. """ if self.overflow: ctx.ensure_object(Config).update(dict(overflow=self.overflow)) return super(ClickGroup,...
python
def invoke(self, ctx): """Inject overflow arguments into context state. :param click.core.Context ctx: Click context. :return: super() return value. """ if self.overflow: ctx.ensure_object(Config).update(dict(overflow=self.overflow)) return super(ClickGroup,...
[ "def", "invoke", "(", "self", ",", "ctx", ")", ":", "if", "self", ".", "overflow", ":", "ctx", ".", "ensure_object", "(", "Config", ")", ".", "update", "(", "dict", "(", "overflow", "=", "self", ".", "overflow", ")", ")", "return", "super", "(", "C...
Inject overflow arguments into context state. :param click.core.Context ctx: Click context. :return: super() return value.
[ "Inject", "overflow", "arguments", "into", "context", "state", "." ]
920edec0ac764081b583a2ecf4e6952762b9dbf2
https://github.com/Robpol86/sphinxcontrib-versioning/blob/920edec0ac764081b583a2ecf4e6952762b9dbf2/sphinxcontrib/versioning/__main__.py#L80-L89
train
Robpol86/sphinxcontrib-versioning
sphinxcontrib/versioning/lib.py
Config.from_context
def from_context(cls): """Retrieve this class' instance from the current Click context. :return: Instance of this class. :rtype: Config """ try: ctx = click.get_current_context() except RuntimeError: return cls() return ctx.find_object(cls...
python
def from_context(cls): """Retrieve this class' instance from the current Click context. :return: Instance of this class. :rtype: Config """ try: ctx = click.get_current_context() except RuntimeError: return cls() return ctx.find_object(cls...
[ "def", "from_context", "(", "cls", ")", ":", "try", ":", "ctx", "=", "click", ".", "get_current_context", "(", ")", "except", "RuntimeError", ":", "return", "cls", "(", ")", "return", "ctx", ".", "find_object", "(", "cls", ")" ]
Retrieve this class' instance from the current Click context. :return: Instance of this class. :rtype: Config
[ "Retrieve", "this", "class", "instance", "from", "the", "current", "Click", "context", "." ]
920edec0ac764081b583a2ecf4e6952762b9dbf2
https://github.com/Robpol86/sphinxcontrib-versioning/blob/920edec0ac764081b583a2ecf4e6952762b9dbf2/sphinxcontrib/versioning/lib.py#L81-L91
train
Robpol86/sphinxcontrib-versioning
sphinxcontrib/versioning/lib.py
Config.update
def update(self, params, ignore_set=False, overwrite=False): """Set instance values from dictionary. :param dict params: Click context params. :param bool ignore_set: Skip already-set values instead of raising AttributeError. :param bool overwrite: Allow overwriting already-set values. ...
python
def update(self, params, ignore_set=False, overwrite=False): """Set instance values from dictionary. :param dict params: Click context params. :param bool ignore_set: Skip already-set values instead of raising AttributeError. :param bool overwrite: Allow overwriting already-set values. ...
[ "def", "update", "(", "self", ",", "params", ",", "ignore_set", "=", "False", ",", "overwrite", "=", "False", ")", ":", "log", "=", "logging", ".", "getLogger", "(", "__name__", ")", "valid", "=", "{", "i", "[", "0", "]", "for", "i", "in", "self", ...
Set instance values from dictionary. :param dict params: Click context params. :param bool ignore_set: Skip already-set values instead of raising AttributeError. :param bool overwrite: Allow overwriting already-set values.
[ "Set", "instance", "values", "from", "dictionary", "." ]
920edec0ac764081b583a2ecf4e6952762b9dbf2
https://github.com/Robpol86/sphinxcontrib-versioning/blob/920edec0ac764081b583a2ecf4e6952762b9dbf2/sphinxcontrib/versioning/lib.py#L102-L125
train
Robpol86/sphinxcontrib-versioning
sphinxcontrib/versioning/lib.py
TempDir.cleanup
def cleanup(self): """Recursively delete directory.""" shutil.rmtree(self.name, onerror=lambda *a: os.chmod(a[1], __import__('stat').S_IWRITE) or os.unlink(a[1])) if os.path.exists(self.name): raise IOError(17, "File exists: '{}'".format(self.name))
python
def cleanup(self): """Recursively delete directory.""" shutil.rmtree(self.name, onerror=lambda *a: os.chmod(a[1], __import__('stat').S_IWRITE) or os.unlink(a[1])) if os.path.exists(self.name): raise IOError(17, "File exists: '{}'".format(self.name))
[ "def", "cleanup", "(", "self", ")", ":", "shutil", ".", "rmtree", "(", "self", ".", "name", ",", "onerror", "=", "lambda", "*", "a", ":", "os", ".", "chmod", "(", "a", "[", "1", "]", ",", "__import__", "(", "'stat'", ")", ".", "S_IWRITE", ")", ...
Recursively delete directory.
[ "Recursively", "delete", "directory", "." ]
920edec0ac764081b583a2ecf4e6952762b9dbf2
https://github.com/Robpol86/sphinxcontrib-versioning/blob/920edec0ac764081b583a2ecf4e6952762b9dbf2/sphinxcontrib/versioning/lib.py#L165-L169
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/trunk.py
NexusMDTrunkHandler.update_subports
def update_subports(self, port): """Set port attributes for trunk subports. For baremetal deployments only, set the neutron port attributes during the bind_port event. """ trunk_details = port.get('trunk_details') subports = trunk_details['sub_ports'] host_id = ...
python
def update_subports(self, port): """Set port attributes for trunk subports. For baremetal deployments only, set the neutron port attributes during the bind_port event. """ trunk_details = port.get('trunk_details') subports = trunk_details['sub_ports'] host_id = ...
[ "def", "update_subports", "(", "self", ",", "port", ")", ":", "trunk_details", "=", "port", ".", "get", "(", "'trunk_details'", ")", "subports", "=", "trunk_details", "[", "'sub_ports'", "]", "host_id", "=", "port", ".", "get", "(", "bc", ".", "dns", "."...
Set port attributes for trunk subports. For baremetal deployments only, set the neutron port attributes during the bind_port event.
[ "Set", "port", "attributes", "for", "trunk", "subports", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/trunk.py#L52-L74
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/vdp/dfa_vdp_mgr.py
VdpMgr.read_static_uplink
def read_static_uplink(self): """Read the static uplink from file, if given.""" if self.node_list is None or self.node_uplink_list is None: return for node, port in zip(self.node_list.split(','), self.node_uplink_list.split(',')): if node.str...
python
def read_static_uplink(self): """Read the static uplink from file, if given.""" if self.node_list is None or self.node_uplink_list is None: return for node, port in zip(self.node_list.split(','), self.node_uplink_list.split(',')): if node.str...
[ "def", "read_static_uplink", "(", "self", ")", ":", "if", "self", ".", "node_list", "is", "None", "or", "self", ".", "node_uplink_list", "is", "None", ":", "return", "for", "node", ",", "port", "in", "zip", "(", "self", ".", "node_list", ".", "split", ...
Read the static uplink from file, if given.
[ "Read", "the", "static", "uplink", "from", "file", "if", "given", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/dfa_vdp_mgr.py#L168-L177
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/vdp/dfa_vdp_mgr.py
VdpMgr.vdp_vlan_change_cb
def vdp_vlan_change_cb(self, port_uuid, lvid, vdp_vlan, fail_reason): """Callback function for updating the VDP VLAN in DB. """ LOG.info("Vlan change CB lvid %(lvid)s VDP %(vdp)s", {'lvid': lvid, 'vdp': vdp_vlan}) self.update_vm_result(port_uuid, constants.RESULT_SUCCESS, ...
python
def vdp_vlan_change_cb(self, port_uuid, lvid, vdp_vlan, fail_reason): """Callback function for updating the VDP VLAN in DB. """ LOG.info("Vlan change CB lvid %(lvid)s VDP %(vdp)s", {'lvid': lvid, 'vdp': vdp_vlan}) self.update_vm_result(port_uuid, constants.RESULT_SUCCESS, ...
[ "def", "vdp_vlan_change_cb", "(", "self", ",", "port_uuid", ",", "lvid", ",", "vdp_vlan", ",", "fail_reason", ")", ":", "LOG", ".", "info", "(", "\"Vlan change CB lvid %(lvid)s VDP %(vdp)s\"", ",", "{", "'lvid'", ":", "lvid", ",", "'vdp'", ":", "vdp_vlan", "}"...
Callback function for updating the VDP VLAN in DB.
[ "Callback", "function", "for", "updating", "the", "VDP", "VLAN", "in", "DB", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/dfa_vdp_mgr.py#L200-L206
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/vdp/dfa_vdp_mgr.py
VdpMgr.process_bulk_vm_event
def process_bulk_vm_event(self, msg, phy_uplink): """Process the VM bulk event usually after a restart. """ LOG.info("In processing Bulk VM Event status %s", msg) time.sleep(3) if (not self.uplink_det_compl or phy_uplink not in self.ovs_vdp_obj_dict): # This c...
python
def process_bulk_vm_event(self, msg, phy_uplink): """Process the VM bulk event usually after a restart. """ LOG.info("In processing Bulk VM Event status %s", msg) time.sleep(3) if (not self.uplink_det_compl or phy_uplink not in self.ovs_vdp_obj_dict): # This c...
[ "def", "process_bulk_vm_event", "(", "self", ",", "msg", ",", "phy_uplink", ")", ":", "LOG", ".", "info", "(", "\"In processing Bulk VM Event status %s\"", ",", "msg", ")", "time", ".", "sleep", "(", "3", ")", "if", "(", "not", "self", ".", "uplink_det_compl...
Process the VM bulk event usually after a restart.
[ "Process", "the", "VM", "bulk", "event", "usually", "after", "a", "restart", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/dfa_vdp_mgr.py#L241-L269
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/vdp/dfa_vdp_mgr.py
VdpMgr.is_openstack_running
def is_openstack_running(self): """Currently it just checks for the presence of both the bridges. """ try: if (ovs_vdp.is_bridge_present(self.br_ex, self.root_helper) and ovs_vdp.is_bridge_present(self.br_integ, self.root_help...
python
def is_openstack_running(self): """Currently it just checks for the presence of both the bridges. """ try: if (ovs_vdp.is_bridge_present(self.br_ex, self.root_helper) and ovs_vdp.is_bridge_present(self.br_integ, self.root_help...
[ "def", "is_openstack_running", "(", "self", ")", ":", "try", ":", "if", "(", "ovs_vdp", ".", "is_bridge_present", "(", "self", ".", "br_ex", ",", "self", ".", "root_helper", ")", "and", "ovs_vdp", ".", "is_bridge_present", "(", "self", ".", "br_integ", ","...
Currently it just checks for the presence of both the bridges.
[ "Currently", "it", "just", "checks", "for", "the", "presence", "of", "both", "the", "bridges", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/dfa_vdp_mgr.py#L368-L379
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/vdp/dfa_vdp_mgr.py
VdpMgr._fill_topology_cfg
def _fill_topology_cfg(self, topo_dict): """Fills the extra configurations in the topology. """ cfg_dict = {} if topo_dict.bond_member_ports is not None: cfg_dict.update({'bond_member_ports': topo_dict.bond_member_ports}) if topo_dict.bond_interfa...
python
def _fill_topology_cfg(self, topo_dict): """Fills the extra configurations in the topology. """ cfg_dict = {} if topo_dict.bond_member_ports is not None: cfg_dict.update({'bond_member_ports': topo_dict.bond_member_ports}) if topo_dict.bond_interfa...
[ "def", "_fill_topology_cfg", "(", "self", ",", "topo_dict", ")", ":", "cfg_dict", "=", "{", "}", "if", "topo_dict", ".", "bond_member_ports", "is", "not", "None", ":", "cfg_dict", ".", "update", "(", "{", "'bond_member_ports'", ":", "topo_dict", ".", "bond_m...
Fills the extra configurations in the topology.
[ "Fills", "the", "extra", "configurations", "in", "the", "topology", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/dfa_vdp_mgr.py#L404-L413
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/vdp/dfa_vdp_mgr.py
VdpMgr.uplink_bond_intf_process
def uplink_bond_intf_process(self): """Process the case when uplink interface becomes part of a bond. This is called to check if the phy interface became a part of the bond. If the below condition is True, this means, a physical interface that was not a part of a bond was earlier discov...
python
def uplink_bond_intf_process(self): """Process the case when uplink interface becomes part of a bond. This is called to check if the phy interface became a part of the bond. If the below condition is True, this means, a physical interface that was not a part of a bond was earlier discov...
[ "def", "uplink_bond_intf_process", "(", "self", ")", ":", "bond_intf", "=", "sys_utils", ".", "get_bond_intf", "(", "self", ".", "phy_uplink", ")", "if", "bond_intf", "is", "None", ":", "return", "False", "self", ".", "save_uplink", "(", "fail_reason", "=", ...
Process the case when uplink interface becomes part of a bond. This is called to check if the phy interface became a part of the bond. If the below condition is True, this means, a physical interface that was not a part of a bond was earlier discovered as uplink and now that interface b...
[ "Process", "the", "case", "when", "uplink", "interface", "becomes", "part", "of", "a", "bond", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/dfa_vdp_mgr.py#L439-L483
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/vdp/dfa_vdp_mgr.py
VdpMgr.check_periodic_bulk_vm_notif_rcvd
def check_periodic_bulk_vm_notif_rcvd(self): """Bulk VM check handler called from periodic uplink detection. This gets called by the 'normal' stage of uplink detection. The bulk VM event sends all the VM's running in this agent. Sometimes during upgrades, it was found that due to some r...
python
def check_periodic_bulk_vm_notif_rcvd(self): """Bulk VM check handler called from periodic uplink detection. This gets called by the 'normal' stage of uplink detection. The bulk VM event sends all the VM's running in this agent. Sometimes during upgrades, it was found that due to some r...
[ "def", "check_periodic_bulk_vm_notif_rcvd", "(", "self", ")", ":", "if", "not", "self", ".", "bulk_vm_rcvd_flag", ":", "if", "self", ".", "bulk_vm_check_cnt", ">=", "1", ":", "self", ".", "bulk_vm_check_cnt", "=", "0", "self", ".", "save_uplink", "(", "uplink"...
Bulk VM check handler called from periodic uplink detection. This gets called by the 'normal' stage of uplink detection. The bulk VM event sends all the VM's running in this agent. Sometimes during upgrades, it was found that due to some race condition, the server does not send the Bulk...
[ "Bulk", "VM", "check", "handler", "called", "from", "periodic", "uplink", "detection", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/dfa_vdp_mgr.py#L485-L510
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/vdp/dfa_vdp_mgr.py
VdpMgr.static_uplink_detect
def static_uplink_detect(self, veth): """Return the static uplink based on argument passed. The very first time, this function is called, it returns the uplink port read from a file. After restart, when this function is called the first time, it returns 'normal' assuming a veth ...
python
def static_uplink_detect(self, veth): """Return the static uplink based on argument passed. The very first time, this function is called, it returns the uplink port read from a file. After restart, when this function is called the first time, it returns 'normal' assuming a veth ...
[ "def", "static_uplink_detect", "(", "self", ",", "veth", ")", ":", "LOG", ".", "info", "(", "\"In static_uplink_detect %(veth)s\"", ",", "{", "'veth'", ":", "veth", "}", ")", "if", "self", ".", "static_uplink_first", ":", "self", ".", "static_uplink_first", "=...
Return the static uplink based on argument passed. The very first time, this function is called, it returns the uplink port read from a file. After restart, when this function is called the first time, it returns 'normal' assuming a veth is passed to this function which will be ...
[ "Return", "the", "static", "uplink", "based", "on", "argument", "passed", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/vdp/dfa_vdp_mgr.py#L512-L532
train
openstack/networking-cisco
networking_cisco/neutronclient/hostingdevice.py
HostingDeviceGetConfig.get_hosting_device_config
def get_hosting_device_config(self, client, hosting_device_id): """Get config of hosting_device.""" return client.get((self.resource_path + HOSTING_DEVICE_CONFIG) % hosting_device_id)
python
def get_hosting_device_config(self, client, hosting_device_id): """Get config of hosting_device.""" return client.get((self.resource_path + HOSTING_DEVICE_CONFIG) % hosting_device_id)
[ "def", "get_hosting_device_config", "(", "self", ",", "client", ",", "hosting_device_id", ")", ":", "return", "client", ".", "get", "(", "(", "self", ".", "resource_path", "+", "HOSTING_DEVICE_CONFIG", ")", "%", "hosting_device_id", ")" ]
Get config of hosting_device.
[ "Get", "config", "of", "hosting_device", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/neutronclient/hostingdevice.py#L255-L258
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cpnr/cpnr_client.py
CpnrClient.get_client_class
def get_client_class(self, client_class_name): """Returns a specific client class details from CPNR server.""" request_url = self._build_url(['ClientClass', client_class_name]) return self._do_request('GET', request_url)
python
def get_client_class(self, client_class_name): """Returns a specific client class details from CPNR server.""" request_url = self._build_url(['ClientClass', client_class_name]) return self._do_request('GET', request_url)
[ "def", "get_client_class", "(", "self", ",", "client_class_name", ")", ":", "request_url", "=", "self", ".", "_build_url", "(", "[", "'ClientClass'", ",", "client_class_name", "]", ")", "return", "self", ".", "_do_request", "(", "'GET'", ",", "request_url", ")...
Returns a specific client class details from CPNR server.
[ "Returns", "a", "specific", "client", "class", "details", "from", "CPNR", "server", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cpnr/cpnr_client.py#L125-L128
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cpnr/cpnr_client.py
CpnrClient.get_vpn
def get_vpn(self, vpn_name): """Returns a specific VPN name details from CPNR server.""" request_url = self._build_url(['VPN', vpn_name]) return self._do_request('GET', request_url)
python
def get_vpn(self, vpn_name): """Returns a specific VPN name details from CPNR server.""" request_url = self._build_url(['VPN', vpn_name]) return self._do_request('GET', request_url)
[ "def", "get_vpn", "(", "self", ",", "vpn_name", ")", ":", "request_url", "=", "self", ".", "_build_url", "(", "[", "'VPN'", ",", "vpn_name", "]", ")", "return", "self", ".", "_do_request", "(", "'GET'", ",", "request_url", ")" ]
Returns a specific VPN name details from CPNR server.
[ "Returns", "a", "specific", "VPN", "name", "details", "from", "CPNR", "server", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cpnr/cpnr_client.py#L135-L138
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cpnr/cpnr_client.py
CpnrClient.get_scopes
def get_scopes(self, vpnid='.*'): """Returns a list of all the scopes from CPNR server.""" request_url = self._build_url(['Scope'], vpn=vpnid) return self._do_request('GET', request_url)
python
def get_scopes(self, vpnid='.*'): """Returns a list of all the scopes from CPNR server.""" request_url = self._build_url(['Scope'], vpn=vpnid) return self._do_request('GET', request_url)
[ "def", "get_scopes", "(", "self", ",", "vpnid", "=", "'.*'", ")", ":", "request_url", "=", "self", ".", "_build_url", "(", "[", "'Scope'", "]", ",", "vpn", "=", "vpnid", ")", "return", "self", ".", "_do_request", "(", "'GET'", ",", "request_url", ")" ]
Returns a list of all the scopes from CPNR server.
[ "Returns", "a", "list", "of", "all", "the", "scopes", "from", "CPNR", "server", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cpnr/cpnr_client.py#L140-L143
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cpnr/cpnr_client.py
CpnrClient.get_scope
def get_scope(self, scope_name): """Returns a specific scope name details from CPNR server.""" request_url = self._build_url(['Scope', scope_name]) return self._do_request('GET', request_url)
python
def get_scope(self, scope_name): """Returns a specific scope name details from CPNR server.""" request_url = self._build_url(['Scope', scope_name]) return self._do_request('GET', request_url)
[ "def", "get_scope", "(", "self", ",", "scope_name", ")", ":", "request_url", "=", "self", ".", "_build_url", "(", "[", "'Scope'", ",", "scope_name", "]", ")", "return", "self", ".", "_do_request", "(", "'GET'", ",", "request_url", ")" ]
Returns a specific scope name details from CPNR server.
[ "Returns", "a", "specific", "scope", "name", "details", "from", "CPNR", "server", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cpnr/cpnr_client.py#L145-L148
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cpnr/cpnr_client.py
CpnrClient.get_client_entry
def get_client_entry(self, client_entry_name): """Returns a specific client entry name details from CPNR server.""" request_url = self._build_url(['ClientEntry', client_entry_name]) return self._do_request('GET', request_url)
python
def get_client_entry(self, client_entry_name): """Returns a specific client entry name details from CPNR server.""" request_url = self._build_url(['ClientEntry', client_entry_name]) return self._do_request('GET', request_url)
[ "def", "get_client_entry", "(", "self", ",", "client_entry_name", ")", ":", "request_url", "=", "self", ".", "_build_url", "(", "[", "'ClientEntry'", ",", "client_entry_name", "]", ")", "return", "self", ".", "_do_request", "(", "'GET'", ",", "request_url", ")...
Returns a specific client entry name details from CPNR server.
[ "Returns", "a", "specific", "client", "entry", "name", "details", "from", "CPNR", "server", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cpnr/cpnr_client.py#L155-L158
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cpnr/cpnr_client.py
CpnrClient.release_address
def release_address(self, address, vpnid): """Release a specific lease, called after delete_client_entry""" query = address + "?action=releaseAddress&vpnId=" + vpnid request_url = self._build_url(['Lease', query]) return self._do_request('DELETE', request_url)
python
def release_address(self, address, vpnid): """Release a specific lease, called after delete_client_entry""" query = address + "?action=releaseAddress&vpnId=" + vpnid request_url = self._build_url(['Lease', query]) return self._do_request('DELETE', request_url)
[ "def", "release_address", "(", "self", ",", "address", ",", "vpnid", ")", ":", "query", "=", "address", "+", "\"?action=releaseAddress&vpnId=\"", "+", "vpnid", "request_url", "=", "self", ".", "_build_url", "(", "[", "'Lease'", ",", "query", "]", ")", "retur...
Release a specific lease, called after delete_client_entry
[ "Release", "a", "specific", "lease", "called", "after", "delete_client_entry" ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cpnr/cpnr_client.py#L346-L350
train
openstack/networking-cisco
networking_cisco/plugins/cisco/cfg_agent/service_helpers/service_helper.py
QueueMixin.qsize
def qsize(self, qname): """Return the approximate size of the queue.""" if qname in self._queues: return self._queues[qname].qsize() else: raise ValueError(_("queue %s is not defined"), qname)
python
def qsize(self, qname): """Return the approximate size of the queue.""" if qname in self._queues: return self._queues[qname].qsize() else: raise ValueError(_("queue %s is not defined"), qname)
[ "def", "qsize", "(", "self", ",", "qname", ")", ":", "if", "qname", "in", "self", ".", "_queues", ":", "return", "self", ".", "_queues", "[", "qname", "]", ".", "qsize", "(", ")", "else", ":", "raise", "ValueError", "(", "_", "(", "\"queue %s is not ...
Return the approximate size of the queue.
[ "Return", "the", "approximate", "size", "of", "the", "queue", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/plugins/cisco/cfg_agent/service_helpers/service_helper.py#L92-L97
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/nexus_db_v2.py
get_nexusport_binding
def get_nexusport_binding(port_id, vlan_id, switch_ip, instance_id): """Lists a nexusport binding.""" LOG.debug("get_nexusport_binding() called") return _lookup_all_nexus_bindings(port_id=port_id, vlan_id=vlan_id, switch_ip=switch_i...
python
def get_nexusport_binding(port_id, vlan_id, switch_ip, instance_id): """Lists a nexusport binding.""" LOG.debug("get_nexusport_binding() called") return _lookup_all_nexus_bindings(port_id=port_id, vlan_id=vlan_id, switch_ip=switch_i...
[ "def", "get_nexusport_binding", "(", "port_id", ",", "vlan_id", ",", "switch_ip", ",", "instance_id", ")", ":", "LOG", ".", "debug", "(", "\"get_nexusport_binding() called\"", ")", "return", "_lookup_all_nexus_bindings", "(", "port_id", "=", "port_id", ",", "vlan_id...
Lists a nexusport binding.
[ "Lists", "a", "nexusport", "binding", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_db_v2.py#L37-L43
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/nexus_db_v2.py
get_nexus_switchport_binding
def get_nexus_switchport_binding(port_id, switch_ip): """Lists all bindings for this switch & port.""" LOG.debug("get_nexus_switchport_binding() called") return _lookup_all_nexus_bindings(port_id=port_id, switch_ip=switch_ip)
python
def get_nexus_switchport_binding(port_id, switch_ip): """Lists all bindings for this switch & port.""" LOG.debug("get_nexus_switchport_binding() called") return _lookup_all_nexus_bindings(port_id=port_id, switch_ip=switch_ip)
[ "def", "get_nexus_switchport_binding", "(", "port_id", ",", "switch_ip", ")", ":", "LOG", ".", "debug", "(", "\"get_nexus_switchport_binding() called\"", ")", "return", "_lookup_all_nexus_bindings", "(", "port_id", "=", "port_id", ",", "switch_ip", "=", "switch_ip", "...
Lists all bindings for this switch & port.
[ "Lists", "all", "bindings", "for", "this", "switch", "&", "port", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_db_v2.py#L46-L50
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/nexus_db_v2.py
get_nexusvlan_binding
def get_nexusvlan_binding(vlan_id, switch_ip): """Lists a vlan and switch binding.""" LOG.debug("get_nexusvlan_binding() called") return _lookup_all_nexus_bindings(vlan_id=vlan_id, switch_ip=switch_ip)
python
def get_nexusvlan_binding(vlan_id, switch_ip): """Lists a vlan and switch binding.""" LOG.debug("get_nexusvlan_binding() called") return _lookup_all_nexus_bindings(vlan_id=vlan_id, switch_ip=switch_ip)
[ "def", "get_nexusvlan_binding", "(", "vlan_id", ",", "switch_ip", ")", ":", "LOG", ".", "debug", "(", "\"get_nexusvlan_binding() called\"", ")", "return", "_lookup_all_nexus_bindings", "(", "vlan_id", "=", "vlan_id", ",", "switch_ip", "=", "switch_ip", ")" ]
Lists a vlan and switch binding.
[ "Lists", "a", "vlan", "and", "switch", "binding", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_db_v2.py#L53-L56
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/nexus_db_v2.py
get_reserved_bindings
def get_reserved_bindings(vlan_id, instance_id, switch_ip=None, port_id=None): """Lists reserved bindings.""" LOG.debug("get_reserved_bindings() called") if port_id: return _lookup_all_nexus_bindings(vlan_id=vlan_id, switch_ip=switc...
python
def get_reserved_bindings(vlan_id, instance_id, switch_ip=None, port_id=None): """Lists reserved bindings.""" LOG.debug("get_reserved_bindings() called") if port_id: return _lookup_all_nexus_bindings(vlan_id=vlan_id, switch_ip=switc...
[ "def", "get_reserved_bindings", "(", "vlan_id", ",", "instance_id", ",", "switch_ip", "=", "None", ",", "port_id", "=", "None", ")", ":", "LOG", ".", "debug", "(", "\"get_reserved_bindings() called\"", ")", "if", "port_id", ":", "return", "_lookup_all_nexus_bindin...
Lists reserved bindings.
[ "Lists", "reserved", "bindings", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_db_v2.py#L59-L74
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/nexus_db_v2.py
update_reserved_binding
def update_reserved_binding(vlan_id, switch_ip, instance_id, port_id, is_switch_binding=True, is_native=False, ch_grp=0): """Updates reserved binding. This overloads port bindings to support reserved Switch binding used to maintain the state of a swit...
python
def update_reserved_binding(vlan_id, switch_ip, instance_id, port_id, is_switch_binding=True, is_native=False, ch_grp=0): """Updates reserved binding. This overloads port bindings to support reserved Switch binding used to maintain the state of a swit...
[ "def", "update_reserved_binding", "(", "vlan_id", ",", "switch_ip", ",", "instance_id", ",", "port_id", ",", "is_switch_binding", "=", "True", ",", "is_native", "=", "False", ",", "ch_grp", "=", "0", ")", ":", "if", "not", "port_id", ":", "LOG", ".", "warn...
Updates reserved binding. This overloads port bindings to support reserved Switch binding used to maintain the state of a switch so it can be viewed by all other neutron processes. There's also the case of a reserved port binding to keep switch information on a given interface. The values of t...
[ "Updates", "reserved", "binding", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_db_v2.py#L77-L119
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/nexus_db_v2.py
remove_reserved_binding
def remove_reserved_binding(vlan_id, switch_ip, instance_id, port_id): """Removes reserved binding. This overloads port bindings to support reserved Switch binding used to maintain the state of a switch so it can be viewed by all other neutron processes. There's also the cas...
python
def remove_reserved_binding(vlan_id, switch_ip, instance_id, port_id): """Removes reserved binding. This overloads port bindings to support reserved Switch binding used to maintain the state of a switch so it can be viewed by all other neutron processes. There's also the cas...
[ "def", "remove_reserved_binding", "(", "vlan_id", ",", "switch_ip", ",", "instance_id", ",", "port_id", ")", ":", "if", "not", "port_id", ":", "LOG", ".", "warning", "(", "\"remove_reserved_binding called with no state\"", ")", "return", "LOG", ".", "debug", "(", ...
Removes reserved binding. This overloads port bindings to support reserved Switch binding used to maintain the state of a switch so it can be viewed by all other neutron processes. There's also the case of a reserved port binding to keep switch information on a given interface. The values of th...
[ "Removes", "reserved", "binding", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_db_v2.py#L122-L151
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/nexus_db_v2.py
add_reserved_switch_binding
def add_reserved_switch_binding(switch_ip, state): """Add a reserved switch binding.""" # overload port_id to contain switch state add_nexusport_binding( state, const.NO_VLAN_OR_VNI_ID, const.NO_VLAN_OR_VNI_ID, switch_ip, const.RESERVED_NEXUS_SWITCH_DEVICE_ID_R1)
python
def add_reserved_switch_binding(switch_ip, state): """Add a reserved switch binding.""" # overload port_id to contain switch state add_nexusport_binding( state, const.NO_VLAN_OR_VNI_ID, const.NO_VLAN_OR_VNI_ID, switch_ip, const.RESERVED_NEXUS_SWITCH_DEVICE_ID_R1)
[ "def", "add_reserved_switch_binding", "(", "switch_ip", ",", "state", ")", ":", "add_nexusport_binding", "(", "state", ",", "const", ".", "NO_VLAN_OR_VNI_ID", ",", "const", ".", "NO_VLAN_OR_VNI_ID", ",", "switch_ip", ",", "const", ".", "RESERVED_NEXUS_SWITCH_DEVICE_ID...
Add a reserved switch binding.
[ "Add", "a", "reserved", "switch", "binding", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_db_v2.py#L163-L172
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/nexus_db_v2.py
update_reserved_switch_binding
def update_reserved_switch_binding(switch_ip, state): """Update a reserved switch binding.""" # overload port_id to contain switch state update_reserved_binding( const.NO_VLAN_OR_VNI_ID, switch_ip, const.RESERVED_NEXUS_SWITCH_DEVICE_ID_R1, state)
python
def update_reserved_switch_binding(switch_ip, state): """Update a reserved switch binding.""" # overload port_id to contain switch state update_reserved_binding( const.NO_VLAN_OR_VNI_ID, switch_ip, const.RESERVED_NEXUS_SWITCH_DEVICE_ID_R1, state)
[ "def", "update_reserved_switch_binding", "(", "switch_ip", ",", "state", ")", ":", "update_reserved_binding", "(", "const", ".", "NO_VLAN_OR_VNI_ID", ",", "switch_ip", ",", "const", ".", "RESERVED_NEXUS_SWITCH_DEVICE_ID_R1", ",", "state", ")" ]
Update a reserved switch binding.
[ "Update", "a", "reserved", "switch", "binding", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_db_v2.py#L175-L183
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/nexus_db_v2.py
add_nexusport_binding
def add_nexusport_binding(port_id, vlan_id, vni, switch_ip, instance_id, is_native=False, ch_grp=0): """Adds a nexusport binding.""" LOG.debug("add_nexusport_binding() called") session = bc.get_writer_session() binding = nexus_models_v2.NexusPortBinding(port_id=port_id, ...
python
def add_nexusport_binding(port_id, vlan_id, vni, switch_ip, instance_id, is_native=False, ch_grp=0): """Adds a nexusport binding.""" LOG.debug("add_nexusport_binding() called") session = bc.get_writer_session() binding = nexus_models_v2.NexusPortBinding(port_id=port_id, ...
[ "def", "add_nexusport_binding", "(", "port_id", ",", "vlan_id", ",", "vni", ",", "switch_ip", ",", "instance_id", ",", "is_native", "=", "False", ",", "ch_grp", "=", "0", ")", ":", "LOG", ".", "debug", "(", "\"add_nexusport_binding() called\"", ")", "session",...
Adds a nexusport binding.
[ "Adds", "a", "nexusport", "binding", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_db_v2.py#L241-L255
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/nexus_db_v2.py
remove_nexusport_binding
def remove_nexusport_binding(port_id, vlan_id, vni, switch_ip, instance_id): """Removes a nexusport binding.""" LOG.debug("remove_nexusport_binding() called") session = bc.get_writer_session() binding = _lookup_all_nexus_bindings(session=session, vlan_id=vlan_id,...
python
def remove_nexusport_binding(port_id, vlan_id, vni, switch_ip, instance_id): """Removes a nexusport binding.""" LOG.debug("remove_nexusport_binding() called") session = bc.get_writer_session() binding = _lookup_all_nexus_bindings(session=session, vlan_id=vlan_id,...
[ "def", "remove_nexusport_binding", "(", "port_id", ",", "vlan_id", ",", "vni", ",", "switch_ip", ",", "instance_id", ")", ":", "LOG", ".", "debug", "(", "\"remove_nexusport_binding() called\"", ")", "session", "=", "bc", ".", "get_writer_session", "(", ")", "bin...
Removes a nexusport binding.
[ "Removes", "a", "nexusport", "binding", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_db_v2.py#L258-L271
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/nexus_db_v2.py
update_nexusport_binding
def update_nexusport_binding(port_id, new_vlan_id): """Updates nexusport binding.""" if not new_vlan_id: LOG.warning("update_nexusport_binding called with no vlan") return LOG.debug("update_nexusport_binding called") session = bc.get_writer_session() binding = _lookup_one_nexus_bindi...
python
def update_nexusport_binding(port_id, new_vlan_id): """Updates nexusport binding.""" if not new_vlan_id: LOG.warning("update_nexusport_binding called with no vlan") return LOG.debug("update_nexusport_binding called") session = bc.get_writer_session() binding = _lookup_one_nexus_bindi...
[ "def", "update_nexusport_binding", "(", "port_id", ",", "new_vlan_id", ")", ":", "if", "not", "new_vlan_id", ":", "LOG", ".", "warning", "(", "\"update_nexusport_binding called with no vlan\"", ")", "return", "LOG", ".", "debug", "(", "\"update_nexusport_binding called\...
Updates nexusport binding.
[ "Updates", "nexusport", "binding", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_db_v2.py#L274-L285
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/nexus_db_v2.py
remove_all_nexusport_bindings
def remove_all_nexusport_bindings(): """Removes all nexusport bindings.""" LOG.debug("remove_all_nexusport_bindings() called") session = bc.get_writer_session() session.query(nexus_models_v2.NexusPortBinding).delete() session.flush()
python
def remove_all_nexusport_bindings(): """Removes all nexusport bindings.""" LOG.debug("remove_all_nexusport_bindings() called") session = bc.get_writer_session() session.query(nexus_models_v2.NexusPortBinding).delete() session.flush()
[ "def", "remove_all_nexusport_bindings", "(", ")", ":", "LOG", ".", "debug", "(", "\"remove_all_nexusport_bindings() called\"", ")", "session", "=", "bc", ".", "get_writer_session", "(", ")", "session", ".", "query", "(", "nexus_models_v2", ".", "NexusPortBinding", "...
Removes all nexusport bindings.
[ "Removes", "all", "nexusport", "bindings", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_db_v2.py#L288-L294
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/nexus_db_v2.py
_lookup_nexus_bindings
def _lookup_nexus_bindings(query_type, session=None, **bfilter): """Look up 'query_type' Nexus bindings matching the filter. :param query_type: 'all', 'one' or 'first' :param session: db session :param bfilter: filter for bindings query :returns: bindings if query gave a result, else r...
python
def _lookup_nexus_bindings(query_type, session=None, **bfilter): """Look up 'query_type' Nexus bindings matching the filter. :param query_type: 'all', 'one' or 'first' :param session: db session :param bfilter: filter for bindings query :returns: bindings if query gave a result, else r...
[ "def", "_lookup_nexus_bindings", "(", "query_type", ",", "session", "=", "None", ",", "**", "bfilter", ")", ":", "if", "session", "is", "None", ":", "session", "=", "bc", ".", "get_reader_session", "(", ")", "query_method", "=", "getattr", "(", "session", ...
Look up 'query_type' Nexus bindings matching the filter. :param query_type: 'all', 'one' or 'first' :param session: db session :param bfilter: filter for bindings query :returns: bindings if query gave a result, else raise NexusPortBindingNotFound.
[ "Look", "up", "query_type", "Nexus", "bindings", "matching", "the", "filter", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_db_v2.py#L330-L349
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/nexus_db_v2.py
add_nexusnve_binding
def add_nexusnve_binding(vni, switch_ip, device_id, mcast_group): """Adds a nexus nve binding.""" LOG.debug("add_nexusnve_binding() called") session = bc.get_writer_session() binding = nexus_models_v2.NexusNVEBinding(vni=vni, switch_ip=switch_ip, ...
python
def add_nexusnve_binding(vni, switch_ip, device_id, mcast_group): """Adds a nexus nve binding.""" LOG.debug("add_nexusnve_binding() called") session = bc.get_writer_session() binding = nexus_models_v2.NexusNVEBinding(vni=vni, switch_ip=switch_ip, ...
[ "def", "add_nexusnve_binding", "(", "vni", ",", "switch_ip", ",", "device_id", ",", "mcast_group", ")", ":", "LOG", ".", "debug", "(", "\"add_nexusnve_binding() called\"", ")", "session", "=", "bc", ".", "get_writer_session", "(", ")", "binding", "=", "nexus_mod...
Adds a nexus nve binding.
[ "Adds", "a", "nexus", "nve", "binding", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_db_v2.py#L364-L374
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/nexus_db_v2.py
remove_nexusnve_binding
def remove_nexusnve_binding(vni, switch_ip, device_id): """Remove the nexus nve binding.""" LOG.debug("remove_nexusnve_binding() called") session = bc.get_writer_session() binding = (session.query(nexus_models_v2.NexusNVEBinding). filter_by(vni=vni, switch_ip=switch_ip, ...
python
def remove_nexusnve_binding(vni, switch_ip, device_id): """Remove the nexus nve binding.""" LOG.debug("remove_nexusnve_binding() called") session = bc.get_writer_session() binding = (session.query(nexus_models_v2.NexusNVEBinding). filter_by(vni=vni, switch_ip=switch_ip, ...
[ "def", "remove_nexusnve_binding", "(", "vni", ",", "switch_ip", ",", "device_id", ")", ":", "LOG", ".", "debug", "(", "\"remove_nexusnve_binding() called\"", ")", "session", "=", "bc", ".", "get_writer_session", "(", ")", "binding", "=", "(", "session", ".", "...
Remove the nexus nve binding.
[ "Remove", "the", "nexus", "nve", "binding", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_db_v2.py#L377-L387
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/nexus_db_v2.py
remove_all_nexusnve_bindings
def remove_all_nexusnve_bindings(): """Removes all nexusnve bindings.""" LOG.debug("remove_all_nexusport_bindings() called") session = bc.get_writer_session() session.query(nexus_models_v2.NexusNVEBinding).delete() session.flush()
python
def remove_all_nexusnve_bindings(): """Removes all nexusnve bindings.""" LOG.debug("remove_all_nexusport_bindings() called") session = bc.get_writer_session() session.query(nexus_models_v2.NexusNVEBinding).delete() session.flush()
[ "def", "remove_all_nexusnve_bindings", "(", ")", ":", "LOG", ".", "debug", "(", "\"remove_all_nexusport_bindings() called\"", ")", "session", "=", "bc", ".", "get_writer_session", "(", ")", "session", ".", "query", "(", "nexus_models_v2", ".", "NexusNVEBinding", ")"...
Removes all nexusnve bindings.
[ "Removes", "all", "nexusnve", "bindings", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_db_v2.py#L390-L396
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/nexus_db_v2.py
_lookup_host_mappings
def _lookup_host_mappings(query_type, session=None, **bfilter): """Look up 'query_type' Nexus mappings matching the filter. :param query_type: 'all', 'one' or 'first' :param session: db session :param bfilter: filter for mappings query :returns: mappings if query gave a result, else ra...
python
def _lookup_host_mappings(query_type, session=None, **bfilter): """Look up 'query_type' Nexus mappings matching the filter. :param query_type: 'all', 'one' or 'first' :param session: db session :param bfilter: filter for mappings query :returns: mappings if query gave a result, else ra...
[ "def", "_lookup_host_mappings", "(", "query_type", ",", "session", "=", "None", ",", "**", "bfilter", ")", ":", "if", "session", "is", "None", ":", "session", "=", "bc", ".", "get_reader_session", "(", ")", "query_method", "=", "getattr", "(", "session", "...
Look up 'query_type' Nexus mappings matching the filter. :param query_type: 'all', 'one' or 'first' :param session: db session :param bfilter: filter for mappings query :returns: mappings if query gave a result, else raise NexusHostMappingNotFound.
[ "Look", "up", "query_type", "Nexus", "mappings", "matching", "the", "filter", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_db_v2.py#L444-L463
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/nexus_db_v2.py
add_host_mapping
def add_host_mapping(host_id, nexus_ip, interface, ch_grp, is_static): """Add Host to interface mapping entry into mapping data base. :param host_id: is the name of the host to add :param interface: is the interface for this host :param nexus_ip: is the ip addr of the nexus switch for this interface ...
python
def add_host_mapping(host_id, nexus_ip, interface, ch_grp, is_static): """Add Host to interface mapping entry into mapping data base. :param host_id: is the name of the host to add :param interface: is the interface for this host :param nexus_ip: is the ip addr of the nexus switch for this interface ...
[ "def", "add_host_mapping", "(", "host_id", ",", "nexus_ip", ",", "interface", ",", "ch_grp", ",", "is_static", ")", ":", "LOG", ".", "debug", "(", "\"add_nexusport_binding() called\"", ")", "session", "=", "bc", ".", "get_writer_session", "(", ")", "mapping", ...
Add Host to interface mapping entry into mapping data base. :param host_id: is the name of the host to add :param interface: is the interface for this host :param nexus_ip: is the ip addr of the nexus switch for this interface :param ch_grp: is the port channel this interface belos :param is_static...
[ "Add", "Host", "to", "interface", "mapping", "entry", "into", "mapping", "data", "base", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_db_v2.py#L496-L525
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/nexus_db_v2.py
remove_host_mapping
def remove_host_mapping(interface, nexus_ip): """Remove host to interface mapping entry from mapping data base.""" LOG.debug("remove_host_mapping() called") session = bc.get_writer_session() try: mapping = _lookup_one_host_mapping( session=session, if...
python
def remove_host_mapping(interface, nexus_ip): """Remove host to interface mapping entry from mapping data base.""" LOG.debug("remove_host_mapping() called") session = bc.get_writer_session() try: mapping = _lookup_one_host_mapping( session=session, if...
[ "def", "remove_host_mapping", "(", "interface", ",", "nexus_ip", ")", ":", "LOG", ".", "debug", "(", "\"remove_host_mapping() called\"", ")", "session", "=", "bc", ".", "get_writer_session", "(", ")", "try", ":", "mapping", "=", "_lookup_one_host_mapping", "(", ...
Remove host to interface mapping entry from mapping data base.
[ "Remove", "host", "to", "interface", "mapping", "entry", "from", "mapping", "data", "base", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_db_v2.py#L544-L557
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/nexus_db_v2.py
remove_all_static_host_mappings
def remove_all_static_host_mappings(): """Remove all entries defined in config file from mapping data base.""" LOG.debug("remove_host_mapping() called") session = bc.get_writer_session() try: mapping = _lookup_all_host_mappings( session=session, is_st...
python
def remove_all_static_host_mappings(): """Remove all entries defined in config file from mapping data base.""" LOG.debug("remove_host_mapping() called") session = bc.get_writer_session() try: mapping = _lookup_all_host_mappings( session=session, is_st...
[ "def", "remove_all_static_host_mappings", "(", ")", ":", "LOG", ".", "debug", "(", "\"remove_host_mapping() called\"", ")", "session", "=", "bc", ".", "get_writer_session", "(", ")", "try", ":", "mapping", "=", "_lookup_all_host_mappings", "(", "session", "=", "se...
Remove all entries defined in config file from mapping data base.
[ "Remove", "all", "entries", "defined", "in", "config", "file", "from", "mapping", "data", "base", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_db_v2.py#L560-L573
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/nexus_db_v2.py
_lookup_vpc_allocs
def _lookup_vpc_allocs(query_type, session=None, order=None, **bfilter): """Look up 'query_type' Nexus VPC Allocs matching the filter. :param query_type: 'all', 'one' or 'first' :param session: db session :param order: select what field to order data :param bfilter: filter for mappings query :r...
python
def _lookup_vpc_allocs(query_type, session=None, order=None, **bfilter): """Look up 'query_type' Nexus VPC Allocs matching the filter. :param query_type: 'all', 'one' or 'first' :param session: db session :param order: select what field to order data :param bfilter: filter for mappings query :r...
[ "def", "_lookup_vpc_allocs", "(", "query_type", ",", "session", "=", "None", ",", "order", "=", "None", ",", "**", "bfilter", ")", ":", "if", "session", "is", "None", ":", "session", "=", "bc", ".", "get_reader_session", "(", ")", "if", "order", ":", "...
Look up 'query_type' Nexus VPC Allocs matching the filter. :param query_type: 'all', 'one' or 'first' :param session: db session :param order: select what field to order data :param bfilter: filter for mappings query :returns: VPCs if query gave a result, else raise NexusVPCAllocNotFou...
[ "Look", "up", "query_type", "Nexus", "VPC", "Allocs", "matching", "the", "filter", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_db_v2.py#L576-L606
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/nexus_db_v2.py
_get_free_vpcids_on_switches
def _get_free_vpcids_on_switches(switch_ip_list): '''Get intersect list of free vpcids in list of switches.''' session = bc.get_reader_session() prev_view = aliased(nexus_models_v2.NexusVPCAlloc) query = session.query(prev_view.vpc_id) prev_swip = switch_ip_list[0] for ip in switch_ip_list[1:...
python
def _get_free_vpcids_on_switches(switch_ip_list): '''Get intersect list of free vpcids in list of switches.''' session = bc.get_reader_session() prev_view = aliased(nexus_models_v2.NexusVPCAlloc) query = session.query(prev_view.vpc_id) prev_swip = switch_ip_list[0] for ip in switch_ip_list[1:...
[ "def", "_get_free_vpcids_on_switches", "(", "switch_ip_list", ")", ":", "session", "=", "bc", ".", "get_reader_session", "(", ")", "prev_view", "=", "aliased", "(", "nexus_models_v2", ".", "NexusVPCAlloc", ")", "query", "=", "session", ".", "query", "(", "prev_v...
Get intersect list of free vpcids in list of switches.
[ "Get", "intersect", "list", "of", "free", "vpcids", "in", "list", "of", "switches", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_db_v2.py#L649-L670
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/nexus_db_v2.py
update_vpc_entry
def update_vpc_entry(nexus_ips, vpc_id, learned, active): """Change active state in vpc_allocate data base.""" LOG.debug("update_vpc_entry called") session = bc.get_writer_session() with session.begin(): for n_ip in nexus_ips: flipit = not active x = session.execute( ...
python
def update_vpc_entry(nexus_ips, vpc_id, learned, active): """Change active state in vpc_allocate data base.""" LOG.debug("update_vpc_entry called") session = bc.get_writer_session() with session.begin(): for n_ip in nexus_ips: flipit = not active x = session.execute( ...
[ "def", "update_vpc_entry", "(", "nexus_ips", ",", "vpc_id", ",", "learned", ",", "active", ")", ":", "LOG", ".", "debug", "(", "\"update_vpc_entry called\"", ")", "session", "=", "bc", ".", "get_writer_session", "(", ")", "with", "session", ".", "begin", "("...
Change active state in vpc_allocate data base.
[ "Change", "active", "state", "in", "vpc_allocate", "data", "base", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_db_v2.py#L722-L742
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/nexus_db_v2.py
alloc_vpcid
def alloc_vpcid(nexus_ips): """Allocate a vpc id for the given list of switch_ips.""" LOG.debug("alloc_vpc() called") vpc_id = 0 intersect = _get_free_vpcids_on_switches(nexus_ips) for intersect_tuple in intersect: try: update_vpc_entry(nexus_ips, intersect_tuple.vpc_id, ...
python
def alloc_vpcid(nexus_ips): """Allocate a vpc id for the given list of switch_ips.""" LOG.debug("alloc_vpc() called") vpc_id = 0 intersect = _get_free_vpcids_on_switches(nexus_ips) for intersect_tuple in intersect: try: update_vpc_entry(nexus_ips, intersect_tuple.vpc_id, ...
[ "def", "alloc_vpcid", "(", "nexus_ips", ")", ":", "LOG", ".", "debug", "(", "\"alloc_vpc() called\"", ")", "vpc_id", "=", "0", "intersect", "=", "_get_free_vpcids_on_switches", "(", "nexus_ips", ")", "for", "intersect_tuple", "in", "intersect", ":", "try", ":", ...
Allocate a vpc id for the given list of switch_ips.
[ "Allocate", "a", "vpc", "id", "for", "the", "given", "list", "of", "switch_ips", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_db_v2.py#L745-L765
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/nexus_db_v2.py
free_vpcid_for_switch_list
def free_vpcid_for_switch_list(vpc_id, nexus_ips): """Free a vpc id for the given list of switch_ips.""" LOG.debug("free_vpcid_for_switch_list() called") if vpc_id != 0: update_vpc_entry(nexus_ips, vpc_id, False, False)
python
def free_vpcid_for_switch_list(vpc_id, nexus_ips): """Free a vpc id for the given list of switch_ips.""" LOG.debug("free_vpcid_for_switch_list() called") if vpc_id != 0: update_vpc_entry(nexus_ips, vpc_id, False, False)
[ "def", "free_vpcid_for_switch_list", "(", "vpc_id", ",", "nexus_ips", ")", ":", "LOG", ".", "debug", "(", "\"free_vpcid_for_switch_list() called\"", ")", "if", "vpc_id", "!=", "0", ":", "update_vpc_entry", "(", "nexus_ips", ",", "vpc_id", ",", "False", ",", "Fal...
Free a vpc id for the given list of switch_ips.
[ "Free", "a", "vpc", "id", "for", "the", "given", "list", "of", "switch_ips", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_db_v2.py#L768-L773
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/nexus_db_v2.py
free_vpcid_for_switch
def free_vpcid_for_switch(vpc_id, nexus_ip): """Free a vpc id for the given switch_ip.""" LOG.debug("free_vpcid_for_switch() called") if vpc_id != 0: update_vpc_entry([nexus_ip], vpc_id, False, False)
python
def free_vpcid_for_switch(vpc_id, nexus_ip): """Free a vpc id for the given switch_ip.""" LOG.debug("free_vpcid_for_switch() called") if vpc_id != 0: update_vpc_entry([nexus_ip], vpc_id, False, False)
[ "def", "free_vpcid_for_switch", "(", "vpc_id", ",", "nexus_ip", ")", ":", "LOG", ".", "debug", "(", "\"free_vpcid_for_switch() called\"", ")", "if", "vpc_id", "!=", "0", ":", "update_vpc_entry", "(", "[", "nexus_ip", "]", ",", "vpc_id", ",", "False", ",", "F...
Free a vpc id for the given switch_ip.
[ "Free", "a", "vpc", "id", "for", "the", "given", "switch_ip", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_db_v2.py#L776-L781
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/nexus_db_v2.py
delete_vpcid_for_switch
def delete_vpcid_for_switch(vpc_id, switch_ip): """Removes unused vpcid for a switch. :param vpc_id: vpc id to remove :param switch_ip: ip address of the switch """ LOG.debug("delete_vpcid_for_switch called") session = bc.get_writer_session() vpc = _lookup_one_vpc_allocs(vpc_id=vpc_id, ...
python
def delete_vpcid_for_switch(vpc_id, switch_ip): """Removes unused vpcid for a switch. :param vpc_id: vpc id to remove :param switch_ip: ip address of the switch """ LOG.debug("delete_vpcid_for_switch called") session = bc.get_writer_session() vpc = _lookup_one_vpc_allocs(vpc_id=vpc_id, ...
[ "def", "delete_vpcid_for_switch", "(", "vpc_id", ",", "switch_ip", ")", ":", "LOG", ".", "debug", "(", "\"delete_vpcid_for_switch called\"", ")", "session", "=", "bc", ".", "get_writer_session", "(", ")", "vpc", "=", "_lookup_one_vpc_allocs", "(", "vpc_id", "=", ...
Removes unused vpcid for a switch. :param vpc_id: vpc id to remove :param switch_ip: ip address of the switch
[ "Removes", "unused", "vpcid", "for", "a", "switch", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_db_v2.py#L784-L798
train
openstack/networking-cisco
networking_cisco/apps/saf/common/dfa_sys_lib.py
create_process
def create_process(cmd, root_helper=None, addl_env=None, log_output=True): """Create a process object for the given command. The return value will be a tuple of the process object and the list of command arguments used to create it. """ if root_helper: cmd = shlex.split(root_helper) + cmd ...
python
def create_process(cmd, root_helper=None, addl_env=None, log_output=True): """Create a process object for the given command. The return value will be a tuple of the process object and the list of command arguments used to create it. """ if root_helper: cmd = shlex.split(root_helper) + cmd ...
[ "def", "create_process", "(", "cmd", ",", "root_helper", "=", "None", ",", "addl_env", "=", "None", ",", "log_output", "=", "True", ")", ":", "if", "root_helper", ":", "cmd", "=", "shlex", ".", "split", "(", "root_helper", ")", "+", "cmd", "cmd", "=", ...
Create a process object for the given command. The return value will be a tuple of the process object and the list of command arguments used to create it.
[ "Create", "a", "process", "object", "for", "the", "given", "command", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/common/dfa_sys_lib.py#L271-L289
train
openstack/networking-cisco
networking_cisco/apps/saf/common/dfa_sys_lib.py
is_intf_up
def is_intf_up(intf): """Function to check if a interface is up. """ intf_path = '/'.join(('/sys/class/net', intf)) intf_exist = os.path.exists(intf_path) if not intf_exist: LOG.error("Unable to get interface %(intf)s, Interface dir " "%(dir)s does not exist", ...
python
def is_intf_up(intf): """Function to check if a interface is up. """ intf_path = '/'.join(('/sys/class/net', intf)) intf_exist = os.path.exists(intf_path) if not intf_exist: LOG.error("Unable to get interface %(intf)s, Interface dir " "%(dir)s does not exist", ...
[ "def", "is_intf_up", "(", "intf", ")", ":", "intf_path", "=", "'/'", ".", "join", "(", "(", "'/sys/class/net'", ",", "intf", ")", ")", "intf_exist", "=", "os", ".", "path", ".", "exists", "(", "intf_path", ")", "if", "not", "intf_exist", ":", "LOG", ...
Function to check if a interface is up.
[ "Function", "to", "check", "if", "a", "interface", "is", "up", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/common/dfa_sys_lib.py#L393-L410
train
openstack/networking-cisco
networking_cisco/apps/saf/common/dfa_sys_lib.py
get_all_run_phy_intf
def get_all_run_phy_intf(): """Retrieve all physical interfaces that are operationally up. """ intf_list = [] base_dir = '/sys/class/net' dir_exist = os.path.exists(base_dir) if not dir_exist: LOG.error("Unable to get interface list :Base dir %s does not " "exist", base_dir...
python
def get_all_run_phy_intf(): """Retrieve all physical interfaces that are operationally up. """ intf_list = [] base_dir = '/sys/class/net' dir_exist = os.path.exists(base_dir) if not dir_exist: LOG.error("Unable to get interface list :Base dir %s does not " "exist", base_dir...
[ "def", "get_all_run_phy_intf", "(", ")", ":", "intf_list", "=", "[", "]", "base_dir", "=", "'/sys/class/net'", "dir_exist", "=", "os", ".", "path", ".", "exists", "(", "base_dir", ")", "if", "not", "dir_exist", ":", "LOG", ".", "error", "(", "\"Unable to g...
Retrieve all physical interfaces that are operationally up.
[ "Retrieve", "all", "physical", "interfaces", "that", "are", "operationally", "up", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/common/dfa_sys_lib.py#L413-L433
train
openstack/networking-cisco
networking_cisco/ml2_drivers/ucsm/deprecated_network_driver.py
CiscoUcsmDriver.check_vnic_type_and_vendor_info
def check_vnic_type_and_vendor_info(self, vnic_type, profile): """Checks if this vnic_type and vendor device info are supported. Returns True if: 1. the port vnic_type is direct or macvtap and 2. the vendor_id and product_id of the port is supported by this MD Useful in ...
python
def check_vnic_type_and_vendor_info(self, vnic_type, profile): """Checks if this vnic_type and vendor device info are supported. Returns True if: 1. the port vnic_type is direct or macvtap and 2. the vendor_id and product_id of the port is supported by this MD Useful in ...
[ "def", "check_vnic_type_and_vendor_info", "(", "self", ",", "vnic_type", ",", "profile", ")", ":", "if", "vnic_type", "not", "in", "self", ".", "supported_sriov_vnic_types", ":", "LOG", ".", "info", "(", "'Non SR-IOV vnic_type: %s.'", ",", "vnic_type", ")", "retur...
Checks if this vnic_type and vendor device info are supported. Returns True if: 1. the port vnic_type is direct or macvtap and 2. the vendor_id and product_id of the port is supported by this MD Useful in determining if this MD should bind the current port.
[ "Checks", "if", "this", "vnic_type", "and", "vendor", "device", "info", "are", "supported", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/deprecated_network_driver.py#L60-L79
train
openstack/networking-cisco
networking_cisco/ml2_drivers/ucsm/deprecated_network_driver.py
CiscoUcsmDriver._check_for_supported_vendor
def _check_for_supported_vendor(self, profile): """Checks if the port belongs to a supported vendor. Returns True for supported_pci_devs. """ vendor_info = profile.get('pci_vendor_info') if not vendor_info: return False if vendor_info not in self.supported_pc...
python
def _check_for_supported_vendor(self, profile): """Checks if the port belongs to a supported vendor. Returns True for supported_pci_devs. """ vendor_info = profile.get('pci_vendor_info') if not vendor_info: return False if vendor_info not in self.supported_pc...
[ "def", "_check_for_supported_vendor", "(", "self", ",", "profile", ")", ":", "vendor_info", "=", "profile", ".", "get", "(", "'pci_vendor_info'", ")", "if", "not", "vendor_info", ":", "return", "False", "if", "vendor_info", "not", "in", "self", ".", "supported...
Checks if the port belongs to a supported vendor. Returns True for supported_pci_devs.
[ "Checks", "if", "the", "port", "belongs", "to", "a", "supported", "vendor", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/deprecated_network_driver.py#L81-L91
train
openstack/networking-cisco
networking_cisco/ml2_drivers/ucsm/deprecated_network_driver.py
CiscoUcsmDriver._import_ucsmsdk
def _import_ucsmsdk(self): """Imports the Ucsm SDK module. This module is not installed as part of the normal Neutron distributions. It is imported dynamically in this module so that the import can be mocked, allowing unit testing without requiring the installation of UcsSdk. ...
python
def _import_ucsmsdk(self): """Imports the Ucsm SDK module. This module is not installed as part of the normal Neutron distributions. It is imported dynamically in this module so that the import can be mocked, allowing unit testing without requiring the installation of UcsSdk. ...
[ "def", "_import_ucsmsdk", "(", "self", ")", ":", "if", "not", "CONF", ".", "ml2_cisco_ucsm", ".", "ucsm_https_verify", ":", "LOG", ".", "warning", "(", "const", ".", "SSL_WARNING", ")", "from", "networking_cisco", ".", "ml2_drivers", ".", "ucsm", "import", "...
Imports the Ucsm SDK module. This module is not installed as part of the normal Neutron distributions. It is imported dynamically in this module so that the import can be mocked, allowing unit testing without requiring the installation of UcsSdk.
[ "Imports", "the", "Ucsm", "SDK", "module", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/deprecated_network_driver.py#L103-L124
train
openstack/networking-cisco
networking_cisco/ml2_drivers/ucsm/deprecated_network_driver.py
CiscoUcsmDriver._get_server_name
def _get_server_name(self, handle, service_profile_mo, ucsm_ip): """Get the contents of the 'Name' field associated with UCS Server. When a valid connection hande to UCS Manager is handed in, the Name field associated with a UCS Server is returned. """ try: resolved_...
python
def _get_server_name(self, handle, service_profile_mo, ucsm_ip): """Get the contents of the 'Name' field associated with UCS Server. When a valid connection hande to UCS Manager is handed in, the Name field associated with a UCS Server is returned. """ try: resolved_...
[ "def", "_get_server_name", "(", "self", ",", "handle", ",", "service_profile_mo", ",", "ucsm_ip", ")", ":", "try", ":", "resolved_dest", "=", "handle", ".", "ConfigResolveDn", "(", "service_profile_mo", ".", "PnDn", ")", "server_list", "=", "resolved_dest", ".",...
Get the contents of the 'Name' field associated with UCS Server. When a valid connection hande to UCS Manager is handed in, the Name field associated with a UCS Server is returned.
[ "Get", "the", "contents", "of", "the", "Name", "field", "associated", "with", "UCS", "Server", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/deprecated_network_driver.py#L179-L194
train
openstack/networking-cisco
networking_cisco/ml2_drivers/ucsm/deprecated_network_driver.py
CiscoUcsmDriver._create_vlanprofile
def _create_vlanprofile(self, handle, vlan_id, ucsm_ip): """Creates VLAN profile to be assosiated with the Port Profile.""" vlan_name = self.make_vlan_name(vlan_id) vlan_profile_dest = (const.VLAN_PATH + const.VLAN_PROFILE_PATH_PREFIX + vlan_name) try: ...
python
def _create_vlanprofile(self, handle, vlan_id, ucsm_ip): """Creates VLAN profile to be assosiated with the Port Profile.""" vlan_name = self.make_vlan_name(vlan_id) vlan_profile_dest = (const.VLAN_PATH + const.VLAN_PROFILE_PATH_PREFIX + vlan_name) try: ...
[ "def", "_create_vlanprofile", "(", "self", ",", "handle", ",", "vlan_id", ",", "ucsm_ip", ")", ":", "vlan_name", "=", "self", ".", "make_vlan_name", "(", "vlan_id", ")", "vlan_profile_dest", "=", "(", "const", ".", "VLAN_PATH", "+", "const", ".", "VLAN_PROFI...
Creates VLAN profile to be assosiated with the Port Profile.
[ "Creates", "VLAN", "profile", "to", "be", "assosiated", "with", "the", "Port", "Profile", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/deprecated_network_driver.py#L265-L304
train
openstack/networking-cisco
networking_cisco/ml2_drivers/ucsm/deprecated_network_driver.py
CiscoUcsmDriver.create_portprofile
def create_portprofile(self, profile_name, vlan_id, vnic_type, host_id, trunk_vlans): """Top level method to create Port Profiles on the UCS Manager. Calls all the methods responsible for the individual tasks that ultimately result in the creation of the Port Profile on the UCS ...
python
def create_portprofile(self, profile_name, vlan_id, vnic_type, host_id, trunk_vlans): """Top level method to create Port Profiles on the UCS Manager. Calls all the methods responsible for the individual tasks that ultimately result in the creation of the Port Profile on the UCS ...
[ "def", "create_portprofile", "(", "self", ",", "profile_name", ",", "vlan_id", ",", "vnic_type", ",", "host_id", ",", "trunk_vlans", ")", ":", "ucsm_ip", "=", "self", ".", "get_ucsm_ip_for_host", "(", "host_id", ")", "if", "not", "ucsm_ip", ":", "LOG", ".", ...
Top level method to create Port Profiles on the UCS Manager. Calls all the methods responsible for the individual tasks that ultimately result in the creation of the Port Profile on the UCS Manager.
[ "Top", "level", "method", "to", "create", "Port", "Profiles", "on", "the", "UCS", "Manager", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/deprecated_network_driver.py#L434-L476
train
openstack/networking-cisco
networking_cisco/ml2_drivers/ucsm/deprecated_network_driver.py
CiscoUcsmDriver.update_serviceprofile
def update_serviceprofile(self, host_id, vlan_id): """Top level method to update Service Profiles on UCS Manager. Calls all the methods responsible for the individual tasks that ultimately result in a vlan_id getting programed on a server's ethernet ports and the Fabric Interconnect's n...
python
def update_serviceprofile(self, host_id, vlan_id): """Top level method to update Service Profiles on UCS Manager. Calls all the methods responsible for the individual tasks that ultimately result in a vlan_id getting programed on a server's ethernet ports and the Fabric Interconnect's n...
[ "def", "update_serviceprofile", "(", "self", ",", "host_id", ",", "vlan_id", ")", ":", "ucsm_ip", "=", "self", ".", "get_ucsm_ip_for_host", "(", "host_id", ")", "if", "not", "ucsm_ip", ":", "LOG", ".", "info", "(", "'UCS Manager network driver does not have UCSM I...
Top level method to update Service Profiles on UCS Manager. Calls all the methods responsible for the individual tasks that ultimately result in a vlan_id getting programed on a server's ethernet ports and the Fabric Interconnect's network ports.
[ "Top", "level", "method", "to", "update", "Service", "Profiles", "on", "UCS", "Manager", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/deprecated_network_driver.py#L604-L644
train
openstack/networking-cisco
networking_cisco/ml2_drivers/ucsm/deprecated_network_driver.py
CiscoUcsmDriver._delete_port_profile
def _delete_port_profile(self, handle, port_profile, ucsm_ip): """Calls method to delete Port Profile from UCS Manager. If exception is raised by UCSM, then the PP is added to a DB table. The delete timer thread, tried to delete all PPs added to this table when it wakes up. ...
python
def _delete_port_profile(self, handle, port_profile, ucsm_ip): """Calls method to delete Port Profile from UCS Manager. If exception is raised by UCSM, then the PP is added to a DB table. The delete timer thread, tried to delete all PPs added to this table when it wakes up. ...
[ "def", "_delete_port_profile", "(", "self", ",", "handle", ",", "port_profile", ",", "ucsm_ip", ")", ":", "try", ":", "self", ".", "_delete_port_profile_from_ucsm", "(", "handle", ",", "port_profile", ",", "ucsm_ip", ")", "except", "Exception", "as", "e", ":",...
Calls method to delete Port Profile from UCS Manager. If exception is raised by UCSM, then the PP is added to a DB table. The delete timer thread, tried to delete all PPs added to this table when it wakes up.
[ "Calls", "method", "to", "delete", "Port", "Profile", "from", "UCS", "Manager", ".", "If", "exception", "is", "raised", "by", "UCSM", "then", "the", "PP", "is", "added", "to", "a", "DB", "table", ".", "The", "delete", "timer", "thread", "tried", "to", ...
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/deprecated_network_driver.py#L778-L792
train
openstack/networking-cisco
networking_cisco/ml2_drivers/ucsm/deprecated_network_driver.py
CiscoUcsmDriver.delete_all_config_for_vlan
def delete_all_config_for_vlan(self, vlan_id, port_profile, trunk_vlans): """Top level method to delete all config for vlan_id.""" ucsm_ips = list(CONF.ml2_cisco_ucsm.ucsms) for ucsm_ip in ucsm_ips: with self.ucsm_connect_disconnect(ucsm_ip) as han...
python
def delete_all_config_for_vlan(self, vlan_id, port_profile, trunk_vlans): """Top level method to delete all config for vlan_id.""" ucsm_ips = list(CONF.ml2_cisco_ucsm.ucsms) for ucsm_ip in ucsm_ips: with self.ucsm_connect_disconnect(ucsm_ip) as han...
[ "def", "delete_all_config_for_vlan", "(", "self", ",", "vlan_id", ",", "port_profile", ",", "trunk_vlans", ")", ":", "ucsm_ips", "=", "list", "(", "CONF", ".", "ml2_cisco_ucsm", ".", "ucsms", ")", "for", "ucsm_ip", "in", "ucsm_ips", ":", "with", "self", ".",...
Top level method to delete all config for vlan_id.
[ "Top", "level", "method", "to", "delete", "all", "config", "for", "vlan_id", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/deprecated_network_driver.py#L964-L993
train
openstack/networking-cisco
networking_cisco/ml2_drivers/ucsm/deprecated_network_driver.py
CiscoUcsmDriver.ucs_manager_disconnect
def ucs_manager_disconnect(self, handle, ucsm_ip): """Disconnects from the UCS Manager. After the disconnect, the handle associated with this connection is no longer valid. """ try: handle.Logout() except Exception as e: # Raise a Neutron exceptio...
python
def ucs_manager_disconnect(self, handle, ucsm_ip): """Disconnects from the UCS Manager. After the disconnect, the handle associated with this connection is no longer valid. """ try: handle.Logout() except Exception as e: # Raise a Neutron exceptio...
[ "def", "ucs_manager_disconnect", "(", "self", ",", "handle", ",", "ucsm_ip", ")", ":", "try", ":", "handle", ".", "Logout", "(", ")", "except", "Exception", "as", "e", ":", "raise", "cexc", ".", "UcsmDisconnectFailed", "(", "ucsm_ip", "=", "ucsm_ip", ",", ...
Disconnects from the UCS Manager. After the disconnect, the handle associated with this connection is no longer valid.
[ "Disconnects", "from", "the", "UCS", "Manager", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/ucsm/deprecated_network_driver.py#L1009-L1020
train
openstack/networking-cisco
networking_cisco/apps/saf/server/dfa_fail_recovery.py
DfaFailureRecovery.add_events
def add_events(self, **kwargs): """Add failure event into the queue.""" event_q = kwargs.get('event_queue') pri = kwargs.get('priority') if not event_q or not pri: return try: event_type = 'server.failure.recovery' payload = {} ti...
python
def add_events(self, **kwargs): """Add failure event into the queue.""" event_q = kwargs.get('event_queue') pri = kwargs.get('priority') if not event_q or not pri: return try: event_type = 'server.failure.recovery' payload = {} ti...
[ "def", "add_events", "(", "self", ",", "**", "kwargs", ")", ":", "event_q", "=", "kwargs", ".", "get", "(", "'event_queue'", ")", "pri", "=", "kwargs", ".", "get", "(", "'priority'", ")", "if", "not", "event_q", "or", "not", "pri", ":", "return", "tr...
Add failure event into the queue.
[ "Add", "failure", "event", "into", "the", "queue", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/server/dfa_fail_recovery.py#L39-L57
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/topo_disc/topo_disc.py
TopoIntfAttr.init_params
def init_params(self, protocol_interface, phy_interface): """Initializing parameters. """ self.lldp_cfgd = False self.local_intf = protocol_interface self.phy_interface = phy_interface self.remote_evb_cfgd = False self.remote_evb_mode = None self.remote_mgmt_addr ...
python
def init_params(self, protocol_interface, phy_interface): """Initializing parameters. """ self.lldp_cfgd = False self.local_intf = protocol_interface self.phy_interface = phy_interface self.remote_evb_cfgd = False self.remote_evb_mode = None self.remote_mgmt_addr ...
[ "def", "init_params", "(", "self", ",", "protocol_interface", ",", "phy_interface", ")", ":", "self", ".", "lldp_cfgd", "=", "False", "self", ".", "local_intf", "=", "protocol_interface", "self", ".", "phy_interface", "=", "phy_interface", "self", ".", "remote_e...
Initializing parameters.
[ "Initializing", "parameters", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/topo_disc/topo_disc.py#L41-L65
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/topo_disc/topo_disc.py
TopoIntfAttr.cmp_update_bond_intf
def cmp_update_bond_intf(self, bond_interface): """Update the bond interface and its members. Update the bond interface, if this interface is a part of bond Return True if there's a change. """ if bond_interface != self.bond_interface: self.bond_interface = bond_inte...
python
def cmp_update_bond_intf(self, bond_interface): """Update the bond interface and its members. Update the bond interface, if this interface is a part of bond Return True if there's a change. """ if bond_interface != self.bond_interface: self.bond_interface = bond_inte...
[ "def", "cmp_update_bond_intf", "(", "self", ",", "bond_interface", ")", ":", "if", "bond_interface", "!=", "self", ".", "bond_interface", ":", "self", ".", "bond_interface", "=", "bond_interface", "self", ".", "bond_member_ports", "=", "sys_utils", ".", "get_membe...
Update the bond interface and its members. Update the bond interface, if this interface is a part of bond Return True if there's a change.
[ "Update", "the", "bond", "interface", "and", "its", "members", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/topo_disc/topo_disc.py#L71-L81
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/topo_disc/topo_disc.py
TopoIntfAttr.remote_evb_mode_uneq_store
def remote_evb_mode_uneq_store(self, remote_evb_mode): """Saves the EVB mode, if it is not the same as stored. """ if remote_evb_mode != self.remote_evb_mode: self.remote_evb_mode = remote_evb_mode return True return False
python
def remote_evb_mode_uneq_store(self, remote_evb_mode): """Saves the EVB mode, if it is not the same as stored. """ if remote_evb_mode != self.remote_evb_mode: self.remote_evb_mode = remote_evb_mode return True return False
[ "def", "remote_evb_mode_uneq_store", "(", "self", ",", "remote_evb_mode", ")", ":", "if", "remote_evb_mode", "!=", "self", ".", "remote_evb_mode", ":", "self", ".", "remote_evb_mode", "=", "remote_evb_mode", "return", "True", "return", "False" ]
Saves the EVB mode, if it is not the same as stored.
[ "Saves", "the", "EVB", "mode", "if", "it", "is", "not", "the", "same", "as", "stored", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/topo_disc/topo_disc.py#L114-L119
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/topo_disc/topo_disc.py
TopoIntfAttr.remote_evb_cfgd_uneq_store
def remote_evb_cfgd_uneq_store(self, remote_evb_cfgd): """This saves the EVB cfg, if it is not the same as stored. """ if remote_evb_cfgd != self.remote_evb_cfgd: self.remote_evb_cfgd = remote_evb_cfgd return True return False
python
def remote_evb_cfgd_uneq_store(self, remote_evb_cfgd): """This saves the EVB cfg, if it is not the same as stored. """ if remote_evb_cfgd != self.remote_evb_cfgd: self.remote_evb_cfgd = remote_evb_cfgd return True return False
[ "def", "remote_evb_cfgd_uneq_store", "(", "self", ",", "remote_evb_cfgd", ")", ":", "if", "remote_evb_cfgd", "!=", "self", ".", "remote_evb_cfgd", ":", "self", ".", "remote_evb_cfgd", "=", "remote_evb_cfgd", "return", "True", "return", "False" ]
This saves the EVB cfg, if it is not the same as stored.
[ "This", "saves", "the", "EVB", "cfg", "if", "it", "is", "not", "the", "same", "as", "stored", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/topo_disc/topo_disc.py#L121-L126
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/topo_disc/topo_disc.py
TopoIntfAttr.remote_mgmt_addr_uneq_store
def remote_mgmt_addr_uneq_store(self, remote_mgmt_addr): """This function saves the MGMT address, if different from stored. """ if remote_mgmt_addr != self.remote_mgmt_addr: self.remote_mgmt_addr = remote_mgmt_addr return True return False
python
def remote_mgmt_addr_uneq_store(self, remote_mgmt_addr): """This function saves the MGMT address, if different from stored. """ if remote_mgmt_addr != self.remote_mgmt_addr: self.remote_mgmt_addr = remote_mgmt_addr return True return False
[ "def", "remote_mgmt_addr_uneq_store", "(", "self", ",", "remote_mgmt_addr", ")", ":", "if", "remote_mgmt_addr", "!=", "self", ".", "remote_mgmt_addr", ":", "self", ".", "remote_mgmt_addr", "=", "remote_mgmt_addr", "return", "True", "return", "False" ]
This function saves the MGMT address, if different from stored.
[ "This", "function", "saves", "the", "MGMT", "address", "if", "different", "from", "stored", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/topo_disc/topo_disc.py#L128-L133
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/topo_disc/topo_disc.py
TopoIntfAttr.remote_sys_desc_uneq_store
def remote_sys_desc_uneq_store(self, remote_system_desc): """This function saves the system desc, if different from stored. """ if remote_system_desc != self.remote_system_desc: self.remote_system_desc = remote_system_desc return True return False
python
def remote_sys_desc_uneq_store(self, remote_system_desc): """This function saves the system desc, if different from stored. """ if remote_system_desc != self.remote_system_desc: self.remote_system_desc = remote_system_desc return True return False
[ "def", "remote_sys_desc_uneq_store", "(", "self", ",", "remote_system_desc", ")", ":", "if", "remote_system_desc", "!=", "self", ".", "remote_system_desc", ":", "self", ".", "remote_system_desc", "=", "remote_system_desc", "return", "True", "return", "False" ]
This function saves the system desc, if different from stored.
[ "This", "function", "saves", "the", "system", "desc", "if", "different", "from", "stored", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/topo_disc/topo_disc.py#L135-L140
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/topo_disc/topo_disc.py
TopoIntfAttr.remote_sys_name_uneq_store
def remote_sys_name_uneq_store(self, remote_system_name): """This function saves the system name, if different from stored. """ if remote_system_name != self.remote_system_name: self.remote_system_name = remote_system_name return True return False
python
def remote_sys_name_uneq_store(self, remote_system_name): """This function saves the system name, if different from stored. """ if remote_system_name != self.remote_system_name: self.remote_system_name = remote_system_name return True return False
[ "def", "remote_sys_name_uneq_store", "(", "self", ",", "remote_system_name", ")", ":", "if", "remote_system_name", "!=", "self", ".", "remote_system_name", ":", "self", ".", "remote_system_name", "=", "remote_system_name", "return", "True", "return", "False" ]
This function saves the system name, if different from stored.
[ "This", "function", "saves", "the", "system", "name", "if", "different", "from", "stored", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/topo_disc/topo_disc.py#L142-L147
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/topo_disc/topo_disc.py
TopoIntfAttr.remote_port_uneq_store
def remote_port_uneq_store(self, remote_port): """This function saves the port, if different from stored. """ if remote_port != self.remote_port: self.remote_port = remote_port return True return False
python
def remote_port_uneq_store(self, remote_port): """This function saves the port, if different from stored. """ if remote_port != self.remote_port: self.remote_port = remote_port return True return False
[ "def", "remote_port_uneq_store", "(", "self", ",", "remote_port", ")", ":", "if", "remote_port", "!=", "self", ".", "remote_port", ":", "self", ".", "remote_port", "=", "remote_port", "return", "True", "return", "False" ]
This function saves the port, if different from stored.
[ "This", "function", "saves", "the", "port", "if", "different", "from", "stored", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/topo_disc/topo_disc.py#L149-L154
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/topo_disc/topo_disc.py
TopoIntfAttr.remote_chassis_id_mac_uneq_store
def remote_chassis_id_mac_uneq_store(self, remote_chassis_id_mac): """This function saves the Chassis MAC, if different from stored. """ if remote_chassis_id_mac != self.remote_chassis_id_mac: self.remote_chassis_id_mac = remote_chassis_id_mac return True return False
python
def remote_chassis_id_mac_uneq_store(self, remote_chassis_id_mac): """This function saves the Chassis MAC, if different from stored. """ if remote_chassis_id_mac != self.remote_chassis_id_mac: self.remote_chassis_id_mac = remote_chassis_id_mac return True return False
[ "def", "remote_chassis_id_mac_uneq_store", "(", "self", ",", "remote_chassis_id_mac", ")", ":", "if", "remote_chassis_id_mac", "!=", "self", ".", "remote_chassis_id_mac", ":", "self", ".", "remote_chassis_id_mac", "=", "remote_chassis_id_mac", "return", "True", "return", ...
This function saves the Chassis MAC, if different from stored.
[ "This", "function", "saves", "the", "Chassis", "MAC", "if", "different", "from", "stored", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/topo_disc/topo_disc.py#L156-L161
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/topo_disc/topo_disc.py
TopoIntfAttr.remote_port_id_mac_uneq_store
def remote_port_id_mac_uneq_store(self, remote_port_id_mac): """This function saves the port MAC, if different from stored. """ if remote_port_id_mac != self.remote_port_id_mac: self.remote_port_id_mac = remote_port_id_mac return True return False
python
def remote_port_id_mac_uneq_store(self, remote_port_id_mac): """This function saves the port MAC, if different from stored. """ if remote_port_id_mac != self.remote_port_id_mac: self.remote_port_id_mac = remote_port_id_mac return True return False
[ "def", "remote_port_id_mac_uneq_store", "(", "self", ",", "remote_port_id_mac", ")", ":", "if", "remote_port_id_mac", "!=", "self", ".", "remote_port_id_mac", ":", "self", ".", "remote_port_id_mac", "=", "remote_port_id_mac", "return", "True", "return", "False" ]
This function saves the port MAC, if different from stored.
[ "This", "function", "saves", "the", "port", "MAC", "if", "different", "from", "stored", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/topo_disc/topo_disc.py#L163-L168
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/topo_disc/topo_disc.py
TopoDiscPubApi.get_lldp_status
def get_lldp_status(cls, intf): """Retrieves the LLDP status. """ if intf not in cls.topo_intf_obj_dict: LOG.error("Interface %s not configured at all", intf) return False intf_obj = cls.topo_intf_obj_dict.get(intf) return intf_obj.get_lldp_status()
python
def get_lldp_status(cls, intf): """Retrieves the LLDP status. """ if intf not in cls.topo_intf_obj_dict: LOG.error("Interface %s not configured at all", intf) return False intf_obj = cls.topo_intf_obj_dict.get(intf) return intf_obj.get_lldp_status()
[ "def", "get_lldp_status", "(", "cls", ",", "intf", ")", ":", "if", "intf", "not", "in", "cls", ".", "topo_intf_obj_dict", ":", "LOG", ".", "error", "(", "\"Interface %s not configured at all\"", ",", "intf", ")", "return", "False", "intf_obj", "=", "cls", "....
Retrieves the LLDP status.
[ "Retrieves", "the", "LLDP", "status", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/topo_disc/topo_disc.py#L180-L186
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/topo_disc/topo_disc.py
TopoDisc._init_cfg_interfaces
def _init_cfg_interfaces(self, cb, intf_list=None, all_intf=True): """Configure the interfaces during init time. """ if not all_intf: self.intf_list = intf_list else: self.intf_list = sys_utils.get_all_run_phy_intf() self.cb = cb self.intf_attr = {} ...
python
def _init_cfg_interfaces(self, cb, intf_list=None, all_intf=True): """Configure the interfaces during init time. """ if not all_intf: self.intf_list = intf_list else: self.intf_list = sys_utils.get_all_run_phy_intf() self.cb = cb self.intf_attr = {} ...
[ "def", "_init_cfg_interfaces", "(", "self", ",", "cb", ",", "intf_list", "=", "None", ",", "all_intf", "=", "True", ")", ":", "if", "not", "all_intf", ":", "self", ".", "intf_list", "=", "intf_list", "else", ":", "self", ".", "intf_list", "=", "sys_utils...
Configure the interfaces during init time.
[ "Configure", "the", "interfaces", "during", "init", "time", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/topo_disc/topo_disc.py#L208-L216
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/topo_disc/topo_disc.py
TopoDisc.cfg_intf
def cfg_intf(self, protocol_interface, phy_interface=None): """Called by application to add an interface to the list. """ self.intf_list.append(protocol_interface) self.cfg_lldp_interface(protocol_interface, phy_interface)
python
def cfg_intf(self, protocol_interface, phy_interface=None): """Called by application to add an interface to the list. """ self.intf_list.append(protocol_interface) self.cfg_lldp_interface(protocol_interface, phy_interface)
[ "def", "cfg_intf", "(", "self", ",", "protocol_interface", ",", "phy_interface", "=", "None", ")", ":", "self", ".", "intf_list", ".", "append", "(", "protocol_interface", ")", "self", ".", "cfg_lldp_interface", "(", "protocol_interface", ",", "phy_interface", "...
Called by application to add an interface to the list.
[ "Called", "by", "application", "to", "add", "an", "interface", "to", "the", "list", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/topo_disc/topo_disc.py#L218-L221
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/topo_disc/topo_disc.py
TopoDisc.create_attr_obj
def create_attr_obj(self, protocol_interface, phy_interface): """Creates the local interface attribute object and stores it. """ self.intf_attr[protocol_interface] = TopoIntfAttr( protocol_interface, phy_interface) self.store_obj(protocol_interface, self.intf_attr[protocol_interface]...
python
def create_attr_obj(self, protocol_interface, phy_interface): """Creates the local interface attribute object and stores it. """ self.intf_attr[protocol_interface] = TopoIntfAttr( protocol_interface, phy_interface) self.store_obj(protocol_interface, self.intf_attr[protocol_interface]...
[ "def", "create_attr_obj", "(", "self", ",", "protocol_interface", ",", "phy_interface", ")", ":", "self", ".", "intf_attr", "[", "protocol_interface", "]", "=", "TopoIntfAttr", "(", "protocol_interface", ",", "phy_interface", ")", "self", ".", "store_obj", "(", ...
Creates the local interface attribute object and stores it.
[ "Creates", "the", "local", "interface", "attribute", "object", "and", "stores", "it", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/topo_disc/topo_disc.py#L239-L243
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/topo_disc/topo_disc.py
TopoDisc.cmp_store_tlv_params
def cmp_store_tlv_params(self, intf, tlv_data): """Compare and store the received TLV. Compares the received TLV with stored TLV. Store the new TLV if it is different. """ flag = False attr_obj = self.get_attr_obj(intf) remote_evb_mode = self.pub_lldp.get_remote_...
python
def cmp_store_tlv_params(self, intf, tlv_data): """Compare and store the received TLV. Compares the received TLV with stored TLV. Store the new TLV if it is different. """ flag = False attr_obj = self.get_attr_obj(intf) remote_evb_mode = self.pub_lldp.get_remote_...
[ "def", "cmp_store_tlv_params", "(", "self", ",", "intf", ",", "tlv_data", ")", ":", "flag", "=", "False", "attr_obj", "=", "self", ".", "get_attr_obj", "(", "intf", ")", "remote_evb_mode", "=", "self", ".", "pub_lldp", ".", "get_remote_evb_mode", "(", "tlv_d...
Compare and store the received TLV. Compares the received TLV with stored TLV. Store the new TLV if it is different.
[ "Compare", "and", "store", "the", "received", "TLV", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/topo_disc/topo_disc.py#L249-L282
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/topo_disc/topo_disc.py
TopoDisc.cfg_lldp_interface
def cfg_lldp_interface(self, protocol_interface, phy_interface=None): """Cfg LLDP on interface and create object. """ if phy_interface is None: phy_interface = protocol_interface self.create_attr_obj(protocol_interface, phy_interface) ret = self.pub_lldp.enable_lldp(protocol_...
python
def cfg_lldp_interface(self, protocol_interface, phy_interface=None): """Cfg LLDP on interface and create object. """ if phy_interface is None: phy_interface = protocol_interface self.create_attr_obj(protocol_interface, phy_interface) ret = self.pub_lldp.enable_lldp(protocol_...
[ "def", "cfg_lldp_interface", "(", "self", ",", "protocol_interface", ",", "phy_interface", "=", "None", ")", ":", "if", "phy_interface", "is", "None", ":", "phy_interface", "=", "protocol_interface", "self", ".", "create_attr_obj", "(", "protocol_interface", ",", ...
Cfg LLDP on interface and create object.
[ "Cfg", "LLDP", "on", "interface", "and", "create", "object", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/topo_disc/topo_disc.py#L284-L291
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/topo_disc/topo_disc.py
TopoDisc.periodic_discovery_task
def periodic_discovery_task(self): """Periodic task that checks the interface TLV attributes. """ try: self._periodic_task_int() except Exception as exc: LOG.error("Exception caught in periodic discovery task %s", str(exc))
python
def periodic_discovery_task(self): """Periodic task that checks the interface TLV attributes. """ try: self._periodic_task_int() except Exception as exc: LOG.error("Exception caught in periodic discovery task %s", str(exc))
[ "def", "periodic_discovery_task", "(", "self", ")", ":", "try", ":", "self", ".", "_periodic_task_int", "(", ")", "except", "Exception", "as", "exc", ":", "LOG", ".", "error", "(", "\"Exception caught in periodic discovery task %s\"", ",", "str", "(", "exc", ")"...
Periodic task that checks the interface TLV attributes.
[ "Periodic", "task", "that", "checks", "the", "interface", "TLV", "attributes", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/topo_disc/topo_disc.py#L298-L304
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/topo_disc/topo_disc.py
TopoDisc._check_bond_interface_change
def _check_bond_interface_change(self, phy_interface, attr_obj): """Check if there's any change in bond interface. First check if the interface passed itself is a bond-interface and then retrieve the member list and compare. Next, check if the interface passed is a part of the bond inte...
python
def _check_bond_interface_change(self, phy_interface, attr_obj): """Check if there's any change in bond interface. First check if the interface passed itself is a bond-interface and then retrieve the member list and compare. Next, check if the interface passed is a part of the bond inte...
[ "def", "_check_bond_interface_change", "(", "self", ",", "phy_interface", ",", "attr_obj", ")", ":", "bond_phy", "=", "sys_utils", ".", "get_bond_intf", "(", "phy_interface", ")", "if", "sys_utils", ".", "is_intf_bond", "(", "phy_interface", ")", ":", "bond_intf",...
Check if there's any change in bond interface. First check if the interface passed itself is a bond-interface and then retrieve the member list and compare. Next, check if the interface passed is a part of the bond interface and then retrieve the member list and compare.
[ "Check", "if", "there", "s", "any", "change", "in", "bond", "interface", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/topo_disc/topo_disc.py#L306-L321
train
openstack/networking-cisco
networking_cisco/apps/saf/agent/topo_disc/topo_disc.py
TopoDisc._periodic_task_int
def _periodic_task_int(self): """Internal periodic discovery task routine to check TLV attributes. This routine retrieves the LLDP TLC's on all its configured interfaces. If the retrieved TLC is different than the stored TLV, it invokes the callback. """ for intf in self...
python
def _periodic_task_int(self): """Internal periodic discovery task routine to check TLV attributes. This routine retrieves the LLDP TLC's on all its configured interfaces. If the retrieved TLC is different than the stored TLV, it invokes the callback. """ for intf in self...
[ "def", "_periodic_task_int", "(", "self", ")", ":", "for", "intf", "in", "self", ".", "intf_list", ":", "attr_obj", "=", "self", ".", "get_attr_obj", "(", "intf", ")", "status", "=", "attr_obj", ".", "get_lldp_status", "(", ")", "if", "not", "status", ":...
Internal periodic discovery task routine to check TLV attributes. This routine retrieves the LLDP TLC's on all its configured interfaces. If the retrieved TLC is different than the stored TLV, it invokes the callback.
[ "Internal", "periodic", "discovery", "task", "routine", "to", "check", "TLV", "attributes", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/apps/saf/agent/topo_disc/topo_disc.py#L323-L351
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/nexus_restapi_client.py
CiscoNexusRestapiClient._get_cookie
def _get_cookie(self, mgmt_ip, config, refresh=False): """Performs authentication and retries cookie.""" if mgmt_ip not in self.credentials: return None security_data = self.credentials[mgmt_ip] verify = security_data[const.HTTPS_CERT_TUPLE] if not verify: ...
python
def _get_cookie(self, mgmt_ip, config, refresh=False): """Performs authentication and retries cookie.""" if mgmt_ip not in self.credentials: return None security_data = self.credentials[mgmt_ip] verify = security_data[const.HTTPS_CERT_TUPLE] if not verify: ...
[ "def", "_get_cookie", "(", "self", ",", "mgmt_ip", ",", "config", ",", "refresh", "=", "False", ")", ":", "if", "mgmt_ip", "not", "in", "self", ".", "credentials", ":", "return", "None", "security_data", "=", "self", ".", "credentials", "[", "mgmt_ip", "...
Performs authentication and retries cookie.
[ "Performs", "authentication", "and", "retries", "cookie", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/nexus_restapi_client.py#L61-L105
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py
CiscoNexusCfgMonitor._initialize_trunk_interfaces_to_none
def _initialize_trunk_interfaces_to_none(self, switch_ip, replay=True): """Initialize all nexus interfaces to trunk allowed none.""" try: # The following determines if the switch interfaces are # in place. If so, make sure they have a basic trunk # configuration app...
python
def _initialize_trunk_interfaces_to_none(self, switch_ip, replay=True): """Initialize all nexus interfaces to trunk allowed none.""" try: # The following determines if the switch interfaces are # in place. If so, make sure they have a basic trunk # configuration app...
[ "def", "_initialize_trunk_interfaces_to_none", "(", "self", ",", "switch_ip", ",", "replay", "=", "True", ")", ":", "try", ":", "switch_ifs", "=", "self", ".", "_mdriver", ".", "_get_switch_interfaces", "(", "switch_ip", ",", "cfg_only", "=", "(", "False", "if...
Initialize all nexus interfaces to trunk allowed none.
[ "Initialize", "all", "nexus", "interfaces", "to", "trunk", "allowed", "none", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py#L121-L146
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py
CiscoNexusCfgMonitor.replay_config
def replay_config(self, switch_ip): """Sends pending config data in OpenStack to Nexus.""" LOG.debug("Replaying config for switch ip %(switch_ip)s", {'switch_ip': switch_ip}) # Before replaying all config, initialize trunk interfaces # to none as required. If this fai...
python
def replay_config(self, switch_ip): """Sends pending config data in OpenStack to Nexus.""" LOG.debug("Replaying config for switch ip %(switch_ip)s", {'switch_ip': switch_ip}) # Before replaying all config, initialize trunk interfaces # to none as required. If this fai...
[ "def", "replay_config", "(", "self", ",", "switch_ip", ")", ":", "LOG", ".", "debug", "(", "\"Replaying config for switch ip %(switch_ip)s\"", ",", "{", "'switch_ip'", ":", "switch_ip", "}", ")", "try", ":", "self", ".", "_initialize_trunk_interfaces_to_none", "(", ...
Sends pending config data in OpenStack to Nexus.
[ "Sends", "pending", "config", "data", "in", "OpenStack", "to", "Nexus", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py#L148-L203
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py
CiscoNexusCfgMonitor.check_connections
def check_connections(self): """Check connection between OpenStack to Nexus device.""" switch_connections = self._mdriver.get_all_switch_ips() for switch_ip in switch_connections: state = self._mdriver.get_switch_ip_and_active_state(switch_ip) config_failure = self._mdri...
python
def check_connections(self): """Check connection between OpenStack to Nexus device.""" switch_connections = self._mdriver.get_all_switch_ips() for switch_ip in switch_connections: state = self._mdriver.get_switch_ip_and_active_state(switch_ip) config_failure = self._mdri...
[ "def", "check_connections", "(", "self", ")", ":", "switch_connections", "=", "self", ".", "_mdriver", ".", "get_all_switch_ips", "(", ")", "for", "switch_ip", "in", "switch_connections", ":", "state", "=", "self", ".", "_mdriver", ".", "get_switch_ip_and_active_s...
Check connection between OpenStack to Nexus device.
[ "Check", "connection", "between", "OpenStack", "to", "Nexus", "device", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py#L205-L277
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py
CiscoNexusMechanismDriver._pop_vlan_range
def _pop_vlan_range(self, switch_ip, size): """Extract a specific number of vlans from storage. Purpose: Can only send a limited number of vlans to Nexus at a time. Sample Use Cases: 1) vlan_range is a list of vlans. If there is a list 1000, 1001, 1002, thru 2000 and s...
python
def _pop_vlan_range(self, switch_ip, size): """Extract a specific number of vlans from storage. Purpose: Can only send a limited number of vlans to Nexus at a time. Sample Use Cases: 1) vlan_range is a list of vlans. If there is a list 1000, 1001, 1002, thru 2000 and s...
[ "def", "_pop_vlan_range", "(", "self", ",", "switch_ip", ",", "size", ")", ":", "vlan_range", "=", "self", ".", "_get_switch_vlan_range", "(", "switch_ip", ")", "sized_range", "=", "''", "fr", "=", "0", "to", "=", "0", "while", "size", ">", "0", "and", ...
Extract a specific number of vlans from storage. Purpose: Can only send a limited number of vlans to Nexus at a time. Sample Use Cases: 1) vlan_range is a list of vlans. If there is a list 1000, 1001, 1002, thru 2000 and size is 6, then the result is '1000-1005' and 10...
[ "Extract", "a", "specific", "number", "of", "vlans", "from", "storage", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py#L505-L552
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py
CiscoNexusMechanismDriver.get_all_switch_ips
def get_all_switch_ips(self): """Using reserved switch binding get all switch ips.""" switch_connections = [] try: bindings = nxos_db.get_reserved_switch_binding() except excep.NexusPortBindingNotFound: LOG.error("No switch bindings in the port data base") ...
python
def get_all_switch_ips(self): """Using reserved switch binding get all switch ips.""" switch_connections = [] try: bindings = nxos_db.get_reserved_switch_binding() except excep.NexusPortBindingNotFound: LOG.error("No switch bindings in the port data base") ...
[ "def", "get_all_switch_ips", "(", "self", ")", ":", "switch_connections", "=", "[", "]", "try", ":", "bindings", "=", "nxos_db", ".", "get_reserved_switch_binding", "(", ")", "except", "excep", ".", "NexusPortBindingNotFound", ":", "LOG", ".", "error", "(", "\...
Using reserved switch binding get all switch ips.
[ "Using", "reserved", "switch", "binding", "get", "all", "switch", "ips", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py#L578-L590
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py
CiscoNexusMechanismDriver._get_baremetal_switch_info
def _get_baremetal_switch_info(self, link_info): """Get switch_info dictionary from context.""" try: switch_info = link_info['switch_info'] if not isinstance(switch_info, dict): switch_info = jsonutils.loads(switch_info) except Exception as e: ...
python
def _get_baremetal_switch_info(self, link_info): """Get switch_info dictionary from context.""" try: switch_info = link_info['switch_info'] if not isinstance(switch_info, dict): switch_info = jsonutils.loads(switch_info) except Exception as e: ...
[ "def", "_get_baremetal_switch_info", "(", "self", ",", "link_info", ")", ":", "try", ":", "switch_info", "=", "link_info", "[", "'switch_info'", "]", "if", "not", "isinstance", "(", "switch_info", ",", "dict", ")", ":", "switch_info", "=", "jsonutils", ".", ...
Get switch_info dictionary from context.
[ "Get", "switch_info", "dictionary", "from", "context", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py#L620-L632
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py
CiscoNexusMechanismDriver._supported_baremetal_transaction
def _supported_baremetal_transaction(self, context): """Verify transaction is complete and for us.""" port = context.current if self.trunk.is_trunk_subport_baremetal(port): return self._baremetal_set_binding(context) if not nexus_help.is_baremetal(port): return...
python
def _supported_baremetal_transaction(self, context): """Verify transaction is complete and for us.""" port = context.current if self.trunk.is_trunk_subport_baremetal(port): return self._baremetal_set_binding(context) if not nexus_help.is_baremetal(port): return...
[ "def", "_supported_baremetal_transaction", "(", "self", ",", "context", ")", ":", "port", "=", "context", ".", "current", "if", "self", ".", "trunk", ".", "is_trunk_subport_baremetal", "(", "port", ")", ":", "return", "self", ".", "_baremetal_set_binding", "(", ...
Verify transaction is complete and for us.
[ "Verify", "transaction", "is", "complete", "and", "for", "us", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py#L658-L709
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py
CiscoNexusMechanismDriver._get_baremetal_switches
def _get_baremetal_switches(self, port): """Get switch ip addresses from baremetal transaction. This method is used to extract switch information from the transaction where VNIC_TYPE is baremetal. :param port: Received port transaction :returns: list of all switches :re...
python
def _get_baremetal_switches(self, port): """Get switch ip addresses from baremetal transaction. This method is used to extract switch information from the transaction where VNIC_TYPE is baremetal. :param port: Received port transaction :returns: list of all switches :re...
[ "def", "_get_baremetal_switches", "(", "self", ",", "port", ")", ":", "all_switches", "=", "set", "(", ")", "active_switches", "=", "set", "(", ")", "all_link_info", "=", "port", "[", "bc", ".", "portbindings", ".", "PROFILE", "]", "[", "'local_link_informat...
Get switch ip addresses from baremetal transaction. This method is used to extract switch information from the transaction where VNIC_TYPE is baremetal. :param port: Received port transaction :returns: list of all switches :returns: list of only switches which are active
[ "Get", "switch", "ip", "addresses", "from", "baremetal", "transaction", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py#L711-L739
train
openstack/networking-cisco
networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py
CiscoNexusMechanismDriver._get_baremetal_connections
def _get_baremetal_connections(self, port, only_active_switch=False, from_segment=False): """Get switch ips and interfaces from baremetal transaction. This method is used to extract switch/interface information from transacti...
python
def _get_baremetal_connections(self, port, only_active_switch=False, from_segment=False): """Get switch ips and interfaces from baremetal transaction. This method is used to extract switch/interface information from transacti...
[ "def", "_get_baremetal_connections", "(", "self", ",", "port", ",", "only_active_switch", "=", "False", ",", "from_segment", "=", "False", ")", ":", "connections", "=", "[", "]", "is_native", "=", "False", "if", "self", ".", "trunk", ".", "is_trunk_subport", ...
Get switch ips and interfaces from baremetal transaction. This method is used to extract switch/interface information from transactions where VNIC_TYPE is baremetal. :param port: Received port transaction :param only_active_switch: Indicator for selecting c...
[ "Get", "switch", "ips", "and", "interfaces", "from", "baremetal", "transaction", "." ]
aa58a30aec25b86f9aa5952b0863045975debfa9
https://github.com/openstack/networking-cisco/blob/aa58a30aec25b86f9aa5952b0863045975debfa9/networking_cisco/ml2_drivers/nexus/mech_cisco_nexus.py#L741-L804
train