This repository was archived by the owner on Feb 10, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +16
-4
lines changed
Expand file tree Collapse file tree 3 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 11system {
22 login {
33 {% - for user_name , user_details in users .items () -%}
4- {% - if user_details -%}
4+ {% - if user_details and ( user_details . get ( 'password' ) and user_details . get ( 'sshkeys' )) -%}
55 user {{user_name}} {
66 authentication {
77 {% - if user_details .get ('password' ) -%}
88 delete: encrypted-password "{{user_details.password}}";
99 {% - endif -%}
1010 {% - if user_details .get ('sshkeys' ) -%}
1111 {% - for sshkey in user_details .sshkeys -%}
12+ {% - if sshkey .split ()[0] == 'ssh-dss' -%}
1213 delete: {{ sshkey.split()[0] }} "{{ sshkey }}";
14+ {% - else -%}
15+ delete: ssh-dss "{{ sshkey }}";
16+ {% - endif -%}
1317 {% - endfor -%}
1418 {% - endif -%}
19+ }
20+ }
1521 {% - else -%}
1622 delete: user {{user_name}};
1723 {% endif -%}
Original file line number Diff line number Diff line change @@ -2,22 +2,28 @@ system {
22 login {
33 {% - for user_name , user_details in users .items () -%}
44 user {{user_name}} {
5+ {% - if user_details .get ('password' ) or user_details .get ('sshkeys' ) -%}
56 authentication {
67 {% - if user_details .get ('password' ) -%}
78 plain-text-password "{{user_details.password}}";
89 {% - endif -%}
910 {% - if user_details .get ('sshkeys' ) -%}
1011 {% - for sshkey in user_details .sshkeys -%}
12+ {% - if sshkey .split ()[0] == 'ssh-dss' -%}
13+ ssh-dsa "{{ sshkey }}";
14+ {% - else -%}
1115 {{ sshkey.split()[0] }} "{{ sshkey }}";
16+ {% - endif -%}
1217 {% - endfor -%}
1318 {% - endif -%}
1419 }
20+ {% - endif -%}
1521 {% set user_level = user_details .level |default (0) -%}
1622 {% - if user_level == 15 -%}
1723 class super-user;
18- {% - elif user_level = = 5 -%}
24+ {% - elif user_level < 15 and user_level > = 5 -%}
1925 class operator;
20- {% - elif user_level == 1 -%}
26+ {% - elif user_level < 5 and user_level >= 1 -%}
2127 class read-only;
2228 {% elif user_level == 0 -%}
2329 class unauthorized;
Original file line number Diff line number Diff line change 1212
1313setup (
1414 name = "napalm-junos" ,
15- version = "0.6.1 " ,
15+ version = "0.6.2 " ,
1616 packages = find_packages (),
1717 author = "David Barroso, Mircea Ulinic" ,
1818
You can’t perform that action at this time.
0 commit comments