code: def post(method, hmc, uri, uri_parms, body, logon_required,
               wait_for_completion):
          
          assert wait_for_completion is True  # async not supported yet
          lpar_oid = uri_parms[0]
          lpar_uri = '/api/logical-partitions/' + lpar_oid
          try:
              lpar = hmc.lookup_by_uri(lpar_uri)
          except KeyError:
              raise InvalidResourceError(method, uri)
          cpc = lpar.manager.parent
          assert not cpc.dpm_enabled
  
          status = lpar.properties.get('status', None)
          force = body.get('force', False) if body else False
          if status == 'operating' and not force:
              raise ServerError(method, uri, reason=263,
                                message="LPAR {!r} could not be activated "
                                "because the LPAR is in status {} "
                                "(and force was not specified).".
                                format(lpar.name, status))
  
          act_profile_name = body.get('activation-profile-name', None)
          if not act_profile_name:
              act_profile_name = lpar.properties.get(
                  'next-activation-profile-name', None)
          if act_profile_name is None:
              act_profile_name = ''
  
          # Perform the check between LPAR name and profile name
          if act_profile_name != lpar.name:
              raise ServerError(method, uri, reason=263,
                                message="LPAR {!r} could not be activated "
                                "because the name of the image activation "
                                "profile {!r} is different from the LPAR name.".
                                format(lpar.name, act_profile_name))
  
          # Reflect the activation in the resource
          lpar.properties['status'] = LparActivateHandler.get_status()
          lpar.properties['last-used-activation-profile'] = act_profile_name
docs: Operation: Activate Logical Partition (requires classic mode).