a 'Dg @sUddlZddlZddlZddlZddlmZddlZddlmZm Z z0ddl Z e j Z ej e j e e dZeed<WnHeefyzddlmZejZWneyddZYn0Yn0eeZGdd d ejjjZGd d d eZdS) N)Any)subputil)salt blowfish_hash)bcryptcCs tddS)zRaise when called so that importing this module doesn't throw ImportError when this module is not used. In this case, crypt and passlib are not needed. z/crypt and passlib not found, missing dependencyN) ImportError)_r ztddd|gWn"ty8ttd|Yn0dS)Nr-CZyeszFailed to lock user %srr.rr/r'rrr r r lock_passwds  zNetBSD.lock_passwdcCs>ztddd|gWn"ty8ttd|Yn0dS)Nrr8nozFailed to unlock user %sr9r:r r r r6s  zNetBSD.unlock_passwdNcCstddS)NzCannot set the locale.)r'debug)rlocaleZout_fnr r r apply_localeszNetBSD.apply_localecCs&t}t}dd|d|diS)z9Return env vars used in NetBSD package_command operationsZPKG_PATHz1http://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD//z/All)platformreleasemachine)rZ os_releaseZos_archr r r _get_pkg_cmd_environszNetBSD._get_pkg_cmd_environ)forcecCsdS)Nr )rrEr r r update_package_sourcesszNetBSD.update_package_sources)F)N)__name__ __module__ __qualname____doc__Z ci_sudoers_fnZgroup_add_cmd_prefixZ#shadow_empty_locked_passwd_patternsrrboolr5r1r;r6r?rDrF __classcell__r r rr r *s 9   r c@s eZdZdS)DistroN)rGrHrIr r r r rMsrM) functoolsZloggingrrAtypingrZcloudinit.distros.bsdZ cloudinitrrZcryptZMETHOD_BLOWFISHrpartialZmksaltr__annotations__rAttributeErrorZ passlib.hashrhashZ getLoggerrGr'ZdistrosZbsdZBSDr rMr r r r s.