Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BUGFIX: Major overhaul of the Dell x1052 ethernet switch configuratio…
…n code. BREAKING CHANGE: Apply 'ALTER TABLE switchports DROP PRIMARY KEY;' to database.
- Loading branch information
1 parent
9c4adff
commit c50f98b
Showing
12 changed files
with
331 additions
and
260 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
common/src/stack/switch/command/create/host/switch/mapping/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# @copyright@ | ||
# Copyright (c) 2006 - 2017 Teradata | ||
# All rights reserved. Stacki(r) v5.x stacki.com | ||
# https://github.com/Teradata/stacki/blob/master/LICENSE.txt | ||
# @copyright@ | ||
|
||
import stack.commands | ||
from stack.exception import ArgRequired | ||
|
||
class command(stack.commands.HostArgumentProcessor, stack.commands.create.command): | ||
pass | ||
|
||
class Command(command): | ||
""" | ||
This command dynamically maps the interfaces of hosts to ports of a switch. | ||
<arg name="host"> | ||
The hosts to map. If no hosts are supplied, map all hosts. | ||
</arg> | ||
<param type='string' name='switch'> | ||
The switch to map. If no switches are supplied, then map all switches. | ||
</param> | ||
""" | ||
|
||
def run(self, params, args): | ||
switch, = self.fillParams([ ('switch', None) ]) | ||
|
||
switches = self.getHostnames(switch) | ||
hosts = self.getHostnames(args) | ||
|
||
for s in switches: | ||
model = self.getHostAttr(s, 'component.model') | ||
self.runImplementation(model, (s, hosts)) | ||
|
28 changes: 28 additions & 0 deletions
28
common/src/stack/switch/command/create/host/switch/mapping/imp_x1052.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# | ||
# @copyright@ | ||
# Copyright (c) 2006 - 2018 Teradata | ||
# All rights reserved. Stacki(r) v5.x stacki.com | ||
# https://github.com/Teradata/stacki/blob/master/LICENSE.txt | ||
# @copyright@ | ||
# | ||
|
||
import stack.commands | ||
|
||
class Implementation(stack.commands.Implementation): | ||
def run(self, args): | ||
(switch, hosts) = args | ||
|
||
list_switch_mac = self.owner.call('list.switch.mac', [ switch ]) | ||
|
||
for h in self.owner.call('list.host.interface', hosts): | ||
if h['interface'] == 'ipmi': | ||
continue | ||
|
||
for m in list_switch_mac: | ||
if h['host'] == m['host'] and h['interface'] == m['interface']: | ||
params = [ switch, 'host=%s' % h['host'], | ||
'interface=%s' % m['interface'], | ||
'port=%s' % m['port'] ] | ||
self.owner.call('add.switch.host', params) | ||
break | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.