def set_port_profile_created(self, vlan_id, profile_name, device_id):
with self.session.begin(subtransactions=True):<EOL><INDENT>port_profile = self.session.query(<EOL>ucsm_model.PortProfile).filter_by(<EOL>vlan_id=vlan_id, profile_id=profile_name,<EOL>device_id=device_id).first()<EOL>if port_profile:<EOL><INDENT>port_profile.created_on_ucs = True<EOL>self.session.merge(port_profile)<EOL><DEDENT>else:<EOL><INDENT>new_profile = ucsm_model.PortProfile(profile_id=profile_name,<EOL>vlan_id=vlan_id,<EOL>device_id=device_id,<EOL>created_on_ucs=True)<EOL>self.session.add(new_profile)<EOL><DEDENT><DEDENT>
Sets created_on_ucs flag to True.