I would suggest updating to allow chpasswd options, especially the option to provide pre-encrypted passwords:

```python
def set_pass(name, users, password, encrypted=False, crypt_method=None):
```
From ``man chpasswd``:
```
       -c, --crypt-method METHOD
           Use the specified method to encrypt the passwords.

           The available methods are DES, MD5, NONE, and SHA256 or SHA512 if your libc support these methods.

           By default, PAM is used to encrypt the passwords.

       -e, --encrypted
           Supplied passwords are in encrypted form.
```