Skip to content

Commit e3adef4

Browse files
committed
library/gen_passwd.py: from Python 2 to 3
1 parent c6c26e4 commit e3adef4

2 files changed

Lines changed: 19 additions & 18 deletions

File tree

MIGRATION.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,26 @@ On the hosts:
1818

1919
## Roles
2020

21-
| Role name | Modified? | Tested? | Production? | Notes |
22-
|--------------------|:---------:|:--------:|:-----------:|------------------------------------------------------------------------------------------|
23-
|`roles/service` | **YES** | **YES** | NO | Changes in Ansible built-in `apt` module. |
24-
|`roles/ssh_server` | **YES** | **YES** | NO | `lxc_ssh.py` --> `ssh_lxc.py`. |
25-
|`roles/ca` | **YES** | ReadNote | NO | Changes in Ansible built-in `apt` module. Needs update of `ca_manager` to [1] to work. |
26-
|`prepare_host.yaml` | **YES** | **YES** | NO | Debian stretch --> buster and Python 2 --> 3 |
27-
|`roles/ldap` | NO | NO | NO | |
28-
|`roles/nginx` | NO | NO | NO | |
29-
|`roles/projects` | NO | NO | NO | |
30-
|`roles/dns_record` | NO | NO | NO | |
31-
|`roles/openvpn` | NO | NO | NO | |
21+
| Role name | Modified? | Tested? | Production? | Notes |
22+
|--------------------|:---------:|:--------:|:-----------:|----------------------------------------------------------------------|
23+
|`roles/service` | **YES** | **YES** | NO | New `apt` module style for packages. |
24+
|`roles/ssh_server` | **YES** | **YES** | NO | `lxc_ssh.py` --> `ssh_lxc.py`, multi-key support. |
25+
|`roles/ca` | **YES** | ReadNote | NO | New `apt` module style for pacakges. Works with this [ca_manager]. |
26+
|`prepare_host.yaml` | **YES** | **YES** | NO | Migrate Debian release to Buster and Python 2 to 3. |
27+
|`roles/ldap` | NO | NO | NO | |
28+
|`roles/nginx` | NO | NO | NO | |
29+
|`roles/projects` | NO | NO | NO | |
30+
|`roles/dns_record` | NO | NO | NO | |
31+
|`roles/openvpn` | NO | NO | NO | |
3232

3333

3434
## Plugins and Modules
3535

36-
| Plugin/Module name | Modified? | Tested? | Production? | Notes |
37-
|------------------------|:---------:|:---------:|:-----------:|--------------------------------------|
38-
|`connection/lxc_ssh.py` | *REMOVED* | | | |
39-
|`connection/ssh_lxc.py` | **NEW** | **YES** | NO | Replace `lxc_ssh.py`. |
40-
|`library/ssh_cert.py` | **YES** | **YES** | NO | Migrate from `python2` to `python3`. |
36+
| Plugin/Module name | Modified? | Tested? | Production? | Notes |
37+
|------------------------|:---------:|:---------:|:-----------:|-----------------------------|
38+
|`connection/lxc_ssh.py` | *REMOVED* | | | |
39+
|`connection/ssh_lxc.py` | **NEW** | **YES** | NO | Replace `lxc_ssh.py`. |
40+
|`library/ssh_cert.py` | **YES** | **YES** | NO | Migrate Python 2 to 3. |
41+
|`library/gen_passwd.py` | **YES** | **YES** | NO | Migrate Python 2 to 3. |
4142

4243
[1]: https://github.com/LILiK-117bis/ca_manager/tree/peewee3%2Brfc5280

library/gen_passwd.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
# -*- coding: utf-8 -*-
33

44
DOCUMENTATION = '''
@@ -39,7 +39,7 @@ def main():
3939
valid_chars = string.ascii_uppercase + string.ascii_lowercase + \
4040
string.digits
4141

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

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

0 commit comments

Comments
 (0)