Browse Source

library/gen_passwd.py: from Python 2 to 3

python3
Zolfa 5 years ago
parent
commit
9e721636d5
Signed by: zolfa GPG Key ID: E1A43B038C4D6616
2 changed files with 19 additions and 18 deletions
  1. +17
    -16
      MIGRATION.md
  2. +2
    -2
      library/gen_passwd.py

+ 17
- 16
MIGRATION.md View File

@ -18,25 +18,26 @@ On the hosts:
## Roles ## Roles
| Role name | Modified? | Tested? | Production? | Notes |
|--------------------|:---------:|:--------:|:-----------:|------------------------------------------------------------------------------------------|
|`roles/service` | **YES** | **YES** | NO | Changes in Ansible built-in `apt` module. |
|`roles/ssh_server` | **YES** | **YES** | NO | `lxc_ssh.py` --> `ssh_lxc.py`. |
|`roles/ca` | **YES** | ReadNote | NO | Changes in Ansible built-in `apt` module. Needs update of `ca_manager` to [1] to work. |
|`prepare_host.yaml` | **YES** | **YES** | NO | Debian stretch --> buster and Python 2 --> 3 |
|`roles/ldap` | NO | NO | NO | |
|`roles/nginx` | NO | NO | NO | |
|`roles/projects` | NO | NO | NO | |
|`roles/dns_record` | NO | NO | NO | |
|`roles/openvpn` | NO | NO | NO | |
| Role name | Modified? | Tested? | Production? | Notes |
|--------------------|:---------:|:--------:|:-----------:|----------------------------------------------------------------------|
|`roles/service` | **YES** | **YES** | NO | New `apt` module style for packages. |
|`roles/ssh_server` | **YES** | **YES** | NO | `lxc_ssh.py` --> `ssh_lxc.py`, multi-key support. |
|`roles/ca` | **YES** | ReadNote | NO | New `apt` module style for pacakges. Works with this [ca_manager]. |
|`prepare_host.yaml` | **YES** | **YES** | NO | Migrate Debian release to Buster and Python 2 to 3. |
|`roles/ldap` | NO | NO | NO | |
|`roles/nginx` | NO | NO | NO | |
|`roles/projects` | NO | NO | NO | |
|`roles/dns_record` | NO | NO | NO | |
|`roles/openvpn` | NO | NO | NO | |
## Plugins and Modules ## Plugins and Modules
| Plugin/Module name | Modified? | Tested? | Production? | Notes |
|------------------------|:---------:|:---------:|:-----------:|--------------------------------------|
|`connection/lxc_ssh.py` | *REMOVED* | | | |
|`connection/ssh_lxc.py` | **NEW** | **YES** | NO | Replace `lxc_ssh.py`. |
|`library/ssh_cert.py` | **YES** | **YES** | NO | Migrate from `python2` to `python3`. |
| Plugin/Module name | Modified? | Tested? | Production? | Notes |
|------------------------|:---------:|:---------:|:-----------:|-----------------------------|
|`connection/lxc_ssh.py` | *REMOVED* | | | |
|`connection/ssh_lxc.py` | **NEW** | **YES** | NO | Replace `lxc_ssh.py`. |
|`library/ssh_cert.py` | **YES** | **YES** | NO | Migrate Python 2 to 3. |
|`library/gen_passwd.py` | **YES** | **YES** | NO | Migrate Python 2 to 3. |
[1]: https://github.com/LILiK-117bis/ca_manager/tree/peewee3%2Brfc5280 [1]: https://github.com/LILiK-117bis/ca_manager/tree/peewee3%2Brfc5280

+ 2
- 2
library/gen_passwd.py View File

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
DOCUMENTATION = ''' DOCUMENTATION = '''
@ -39,7 +39,7 @@ def main():
valid_chars = string.ascii_uppercase + string.ascii_lowercase + \ valid_chars = string.ascii_uppercase + string.ascii_lowercase + \
string.digits string.digits
passwd = [rng.choice(valid_chars) for _ in xrange(length)]
passwd = [rng.choice(valid_chars) for _ in range(length)]
result['passwd'] = ''.join(passwd) result['passwd'] = ''.join(passwd)


Loading…
Cancel
Save