mirror of
https://github.com/hansjone/netx.git
synced 2026-10-10 20:45:45 +08:00
revert(managed-ne): keep bulk import NE-only
Remove hop columns from the import template and stop applying hop settings during import; use Batch add proxy instead. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
81c028949b
commit
d23b5b7cb0
4 changed files with 4 additions and 93 deletions
|
|
@ -190,23 +190,6 @@ class ManagedNeServiceImportTests(unittest.TestCase):
|
|||
self.assertEqual(row.username, "target-user")
|
||||
self.assertEqual(row.password_enc, "")
|
||||
|
||||
def test_csv_import_with_bastion_hop(self):
|
||||
csv = (
|
||||
"device_type,ip,username,password,port,protocol,name,vendor,"
|
||||
"hop_enabled,hop_vendor,hop_host,hop_port,hop_username,hop_password,hop_target_auth_mode\n"
|
||||
"zte_zxros,2.2.2.2,target-user,,22,ssh,NE-C,ZTE,"
|
||||
"true,bastion,1.1.1.1,22,bastion-user,vault-pass,bastion_managed\n"
|
||||
).encode("utf-8")
|
||||
result = import_managed_ne(self.db, csv, "devices.csv")
|
||||
self.assertEqual(result.inserted, 1)
|
||||
self.assertEqual(len(result.failed), 0)
|
||||
row = self.db.query(ManagedNE).filter(ManagedNE.ip_address == "2.2.2.2").one()
|
||||
self.assertTrue(row.hop_enabled)
|
||||
self.assertEqual(row.hop_vendor, "bastion")
|
||||
self.assertEqual(row.hop_host, "1.1.1.1")
|
||||
self.assertEqual(row.hop_username, "bastion-user")
|
||||
self.assertEqual(decrypt_secret(row.hop_password_enc), "vault-pass")
|
||||
|
||||
|
||||
class ManagedNeCreateOptionalPasswordTests(unittest.TestCase):
|
||||
def setUp(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue