Commit 8a56d40b authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Merge branch 'develop' of https://labs.etsi.org/rep/tfs/controller into...

Merge branch 'develop' of https://labs.etsi.org/rep/tfs/controller into fix/53-update-docker-build-command-in-deploy-scripts
parents 230af993 3d2441a8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -263,7 +263,7 @@ class MockServicerImpl_Context(ContextServiceServicer):
            reply_device.CopyFrom(device)
            if exclude_endpoints:    del reply_device.device_endpoints [:] # pylint: disable=no-member
            if exclude_config_rules: del reply_device.device_config.config_rules[:] # pylint: disable=no-member
            if exclude_components:   del reply_device.component[:] # pylint: disable=no-member
            if exclude_components:   del reply_device.components[:] # pylint: disable=no-member
            devices.append(reply_device)
                
        reply = DeviceList(devices=devices) 
+4 −1
Original line number Diff line number Diff line
@@ -109,6 +109,9 @@ class NetconfSessionHandler:
    @RETRY_DECORATOR
    def get(self, filter=None, with_defaults=None): # pylint: disable=redefined-builtin
        with self.__lock:
            if self.__vendor == 'JUNIPER'and not 'component' in str(filter):
                return self.__manager.get_config(source="running", filter=filter, with_defaults=with_defaults)
            else:
                return self.__manager.get(filter=filter, with_defaults=with_defaults)

    @RETRY_DECORATOR
+1 −3
Original line number Diff line number Diff line
@@ -89,9 +89,7 @@ def parse(xml_data : ET.Element) -> List[Tuple[str, Dict[str, Any]]]:
            add_value_from_tag(inventory['attributes'], 'empty', component_empty)

        component_parent = xml_component.find('ocp:state/ocp:parent', namespaces=NAMESPACES)
        if component_parent is None or component_parent.text is None:
            add_value_from_tag(inventory, 'parent-component-references', component_type)
        else:
        if not component_parent is None: 
            add_value_from_tag(inventory, 'parent-component-references', component_parent)

        component_HW = xml_component.find('ocp:state/ocp:hardware-version', namespaces=NAMESPACES)
+10 −0
Original line number Diff line number Diff line
@@ -150,6 +150,16 @@ def detail(device_uuid: str):
    return render_template(
        'device/detail.html', device=device_obj, dde=DeviceDriverEnum, dose=DeviceOperationalStatusEnum)
    
@device.route('inventory/<path:device_uuid>', methods=['GET', 'POST'])
def inventory(device_uuid: str):
    context_client.connect()
    device_obj = get_device(context_client, device_uuid, rw_copy=False)
    if device_obj is None:
        flash('Device({:s}) not found'.format(str(device_uuid)), 'danger')
        device_obj = Device()
    context_client.close()
    return render_template('device/inventory.html', device=device_obj)

@device.get('<path:device_uuid>/delete')
def delete(device_uuid):
    try:
+0 −36
Original line number Diff line number Diff line
@@ -86,42 +86,6 @@
            </tbody>
        </table>
    </div>
    {% if device.components|length > 0 %}
    <div class="col-sm-8">
        <table class="table table-striped table-hover">
            <thead>
                <tr>
                    <th scope="col">Component UUID</th>
                    <th scope="col">Name</th>
                    <th scope="col">Type</th>
                    <th scope="col">Parent</th>
                    <th scope="col">Attributes</th>
                </tr>
            </thead>
            <tbody>
                {% for component in device.components %}
                <tr>
                    <td>
                        {{ component.component_uuid.uuid }}
                    </td>
                    <td>
                        {{ component.name }}
                    </td>
                    <td>
                        {{ component.type }}
                    </td>
                    <td>
                        {{ component.parent }}
                    </td>
                    <td>
                        {{ component.attributes }}
                    </td>
                </tr>
                {% endfor %}
            </tbody>
        </table>
    </div>
    {% endif %}
</div>

<b>Configurations:</b>
Loading