def enable_mesos_basic_authentication(principal, password):
restart = False<EOL>secrets_file = '<STR_LIT>'<EOL>secrets_entry = '<STR_LIT>' % (principal, password)<EOL>if not file_contains(filename=secrets_file,<EOL>text=secrets_entry, use_sudo=True):<EOL><INDENT>file_append(filename=secrets_file, text=secrets_entry, use_sudo=True)<EOL>file_attribs(secrets_file, mode=<NUM_LIT>, sudo=True)<EOL>restart = True<EOL><DEDENT>with quiet():<EOL><INDENT>if secrets_file not in sudo('<STR_LIT>'):<EOL><INDENT>sudo('<STR_LIT>' % secrets_file)<EOL>restart = True<EOL><DEDENT>if not exists('<STR_LIT>', use_sudo=True):<EOL><INDENT>sudo('<STR_LIT>')<EOL>file_attribs('<STR_LIT>',<EOL>mode=<NUM_LIT>,<EOL>sudo=True)<EOL>restart = True<EOL><DEDENT><DEDENT>if restart:<EOL><INDENT>restart_service('<STR_LIT>')<EOL><DEDENT>
enables and adds a new authorized principal