code: def sudo_popen(*args, **kwargs):
      
      user = kwargs.get("user", None)
      full_command = [SUDO_PATH, SUDO_PRESERVE_ENVIRONMENT_ARG]
      if user:
          full_command.extend([SUDO_USER_ARG, user])
      full_command.extend(args)
      log.info("About to execute the following sudo command - [%s]" % ' '.join(full_command))
      p = Popen(full_command, shell=False, stdout=PIPE, stderr=PIPE)
      return p
docs: Helper method for building and executing Popen command. This is potentially
      sensetive code so should probably be centralized.