'Return True if port has security_groups attribute set and
its not empty, or False otherwise.
This method is called both for port create and port update.'

def _check_update_has_security_groups(self, port):

    if ((ext_sg.SECURITYGROUPS in port['port']) and (validators.is_attr_set(port['port'][ext_sg.SECURITYGROUPS]) and (port['port'][ext_sg.SECURITYGROUPS] != []))):
        return True
    return False
