@@ -92,7 +92,9 @@ def pkg_installed_from_github(
9292 pkg_name = name
9393
9494 installed_version_cmd = f"dpkg-query --showformat='${{Version}}' --show { pkg_name } "
95- installed_version_ret = __salt__ ["cmd.run_all" ](installed_version_cmd , python_shell = False )
95+ installed_version_ret = __salt__ ["cmd.run_all" ](
96+ installed_version_cmd , python_shell = False
97+ )
9698
9799 installed_version = ""
98100 if installed_version_ret ["retcode" ] == 0 :
@@ -124,7 +126,7 @@ def pkg_installed_from_github(
124126 download_start_time = time .time ()
125127 source_url = f"https://github.com/TheCacophonyProject/{ name } /releases/download/v{ version } /{ pkg_name } _{ version } _{ architecture } .deb"
126128 download_ret = __salt__ ["cp.get_url" ](source_url , deb_path , makedirs = True )
127- download_duration = time .time () - download_start_time
129+ download_duration = time .time () - download_start_time
128130 if not download_ret :
129131 ret ["comment" ] = f"Failed to download package from { source_url } "
130132 return ret
@@ -136,10 +138,14 @@ def pkg_installed_from_github(
136138
137139 if install_ret ["retcode" ] != 0 :
138140 ret ["result" ] = False
139- ret ["comment" ] = "dpkg failed to install {}. Stderr: {}" .format (deb_path , install_ret ["stderr" ])
141+ ret ["comment" ] = "dpkg failed to install {}. Stderr: {}" .format (
142+ deb_path , install_ret ["stderr" ]
143+ )
140144 else :
141145 ret ["result" ] = True
142- ret ["comment" ] = f"Package { pkg_name } version { version } installed successfully in { (time .time () - start_time ):.2f} . (download: { download_duration :.2f} s, install: { install_duration :.2f} s)."
146+ ret ["comment" ] = (
147+ f"Package { pkg_name } version { version } installed successfully in { (time .time () - start_time ):.2f} . (download: { download_duration :.2f} s, install: { install_duration :.2f} s)."
148+ )
143149 ret ["changes" ] = {
144150 "old" : installed_version ,
145151 "new" : version ,
@@ -150,9 +156,10 @@ def pkg_installed_from_github(
150156 if os .path .exists (package_tmp_dir ):
151157 os .remove (deb_path )
152158 os .rmdir (package_tmp_dir )
153-
159+
154160 return ret
155161
162+
156163def init_alsa (name ):
157164 """Ensure that the built-in audio hardware is correctly initialised."""
158165 if _is_audio_setup ():
0 commit comments