Skip to content

Commit

Permalink
library/gen_passwd.py: from Python 2 to 3
Browse files Browse the repository at this point in the history
  • Loading branch information
zolfariot committed Apr 3, 2020
1 parent c6c26e4 commit e3adef4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
33 changes: 17 additions & 16 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,26 @@ On the hosts:

## 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

| 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
4 changes: 2 additions & 2 deletions library/gen_passwd.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

DOCUMENTATION = '''
Expand Down Expand Up @@ -39,7 +39,7 @@ def main():
valid_chars = string.ascii_uppercase + string.ascii_lowercase + \
string.digits

passwd = [rng.choice(valid_chars) for _ in xrange(length)]
passwd = [rng.choice(valid_chars) for _ in range(length)]

result['passwd'] = ''.join(passwd)

Expand Down

0 comments on commit e3adef4

Please sign in to comment.