fix(blog-106): sanitize dummy credentials in code examples
Replace literal 'apipass'/'admin' placeholder credentials with explicit <USER>/<PASSWORD> placeholders. Prevents false-positive secrets scan detection in Magatama pre-commit hooks. No real credentials were ever present — these are training data code examples showing API connection patterns.
This commit is contained in:
parent
2c3cc69a78
commit
890ac48ec7
@ -209,7 +209,7 @@ Different failure modes leave distinct signatures in the eye diagram. Learn to s
|
|||||||
from arista.api import eapi
|
from arista.api import eapi
|
||||||
|
|
||||||
def monitor_eye_diagram(switch_ip, port):
|
def monitor_eye_diagram(switch_ip, port):
|
||||||
client = eapi.connect(host=switch_ip, username="apiuser", password="apipass")
|
client = eapi.connect(host=switch_ip, username="<USER>", password="<PASSWORD>")
|
||||||
result = client.runCmds(1, [f"show interfaces Ethernet {port} transceiver eye-diagram"], format="json")
|
result = client.runCmds(1, [f"show interfaces Ethernet {port} transceiver eye-diagram"], format="json")
|
||||||
data = result['result'][0]
|
data = result['result'][0]
|
||||||
return {
|
return {
|
||||||
@ -224,7 +224,7 @@ def monitor_eye_diagram(switch_ip, port):
|
|||||||
from ncclient import manager
|
from ncclient import manager
|
||||||
|
|
||||||
def monitor_eye_diagram_cisco(switch_ip, port):
|
def monitor_eye_diagram_cisco(switch_ip, port):
|
||||||
m = manager.connect(host=switch_ip, username="admin", password="admin", hostkey_verify=False)
|
m = manager.connect(host=switch_ip, username="<USER>", password="<PASSWORD>", hostkey_verify=False)
|
||||||
filter_spec = f'<transceiver><port>{port}</port></transceiver>'
|
filter_spec = f'<transceiver><port>{port}</port></transceiver>'
|
||||||
result = m.get(filter=('xpath', filter_spec))
|
result = m.get(filter=('xpath', filter_spec))
|
||||||
# Parse result for eye diagram metrics
|
# Parse result for eye diagram metrics
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user