def check_vassal_config(self, options): """ Verify is there is uWSGI vassal configuration file and if it doesn't need updating. """ if os.path.exists(self.application.vassal_path): current_hash = calculate_file_sha256(self.application.vassal_path) new_hash = calculate_string_sha256(options) if current_hash == new_hash: return True return False
def is_vassal_config_valid(self, application): if os.path.exists(application.vassal_path): backend_conf = application.run_plan.backend_settings(self.backend) options = "\n".join( application.current_package.generate_uwsgi_config( backend_conf)) return calculate_string_sha256(options) == calculate_file_sha256( application.vassal_path) else: # ignore missing vassals, is_application_running() will handle it return True