(self, sudo_password=None)
Install the profile.

    Args:
      sudo_password: str, the password to use for installing the profile.

    Raises:
      ProfileInstallationError: profile failed to install.
      ProfileValidationError: profile data was not valid.
      ProfileSaveError: profile could not be saved.
Install the profile.
Install the profile .
def Install(self, sudo_password=None):
    """Install the profile.

    Args:
      sudo_password: str, the password to use for installing the profile.

    Raises:
      ProfileInstallationError: profile failed to install.
      ProfileValidationError: profile data was not valid.
      ProfileSaveError: profile could not be saved.
    """
    self._ValidateProfile()

    with tempfile.NamedTemporaryFile(suffix='.mobileconfig',
                                     prefix='profile_') as f:
      temp_file = f.name

      self.Save(temp_file)
      command = [CMD_PROFILES, '-I', '-F', temp_file]

      try:
        (stdout, stderr, status) = gmacpyutil.RunProcess(
            command, sudo=sudo_password, sudo_password=sudo_password)
      except gmacpyutil.GmacpyutilException as e:
        raise ProfileInstallationError('Profile installation failed!\n%s' % e)

      if status:
        raise ProfileInstallationError('Profile installation failed!\n'
                                       '%s, %s, %s' % (stdout, stderr, status))
def Install ( self , sudo_password = None ) : self . _ValidateProfile ( ) with tempfile . NamedTemporaryFile ( suffix = '.mobileconfig' , prefix = 'profile_' ) as f : temp_file = f . name self . Save ( temp_file ) command = [ CMD_PROFILES , '-I' , '-F' , temp_file ] try : ( stdout , stderr , status ) = gmacpyutil . RunProcess ( command , sudo = sudo_password , sudo_password = sudo_password ) except gmacpyutil . GmacpyutilException as e : raise ProfileInstallationError ( 'Profile installation failed!\n%s' % e ) if status : raise ProfileInstallationError ( 'Profile installation failed!\n' '%s, %s, %s' % ( stdout , stderr , status ) )