← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1367542] [NEW] OpenStack Dashboard couldn't displayed nested stack very well

 

Public bug reported:

OpenStack Dashboard couldn't displayed nested stack very well.

Example,
Icehouse OpenStack Dasboard:

In panel "Project" ---> "Orchestration" ---> "Stacks", when clicked tab "Resources", the "Stack Resources" could be displayed very well, continued to click this column's text of "Stack Resource" which is a link in the tables, the tab "Overview" could be displayed very well. Then, clicked this text of "Resource ID" which is a link in the tab "Overview", the displayed content in the html is: 
"The page you were looking for doesn't exist

You may have mistyped the address or the page may have moved."


Root cause:

In the template project/stacks/templates/stacks/_resource_overview.html,
the "resource_url" need to be used.

    <dt>{% trans "Resource ID" %}</dt>
    <dd>
      <a href="{{ resource_url }}">
          {{ resource.physical_resource_id }}
      </a>
    </dd>

the value of resource_url is setted in class "ResourceOverviewTab" in
project/stacks/tabs.py, please see below code:

class ResourceOverviewTab(tabs.Tab):
    name = _("Overview")
    slug = "resource_overview"
    template_name = "project/stacks/_resource_overview.html"

    def get_context_data(self, request):
        resource = self.tab_group.kwargs['resource']
        resource_url = mappings.resource_to_url(resource)
        return {
            "resource": resource,
            "resource_url": resource_url,
            "metadata": self.tab_group.kwargs['metadata']}


the 'resource_urls' dictionary in project/stacks/mappings.py is out of date. It's not updated in Icehouse version, even earlier. some new concerns like Netron couldn't be found these.

resource_urls = {
    "AWS::EC2::Instance": {
        'link': 'horizon:project:instances:detail'},
    "AWS::EC2::NetworkInterface": {
        'link': 'horizon:project:networks:ports:detail'},
    "AWS::EC2::RouteTable": {
        'link': 'horizon:project:routers:detail'},
    "AWS::EC2::Subnet": {
        'link': 'horizon:project:networks:subnets:detail'},
    "AWS::EC2::Volume": {
        'link': 'horizon:project:volumes:volumes:detail'},
    "AWS::EC2::VPC": {
        'link': 'horizon:project:networks:detail'},
    "AWS::S3::Bucket": {
        'link': 'horizon:project:containers:index'},
    "OS::Quantum::Net": {
        'link': 'horizon:project:networks:detail'},
    "OS::Quantum::Port": {
        'link': 'horizon:project:networks:ports:detail'},
    "OS::Quantum::Router": {
        'link': 'horizon:project:routers:detail'},
    "OS::Quantum::Subnet": {
        'link': 'horizon:project:networks:subnets:detail'},
    "OS::Swift::Container": {
        'link': 'horizon:project:containers:index',
        'format_pattern': '%s' + swift.FOLDER_DELIMITER},
} 

Since the "resource_type" could NOT match the type in "resource_urls", the value of "resource_url" in the template is "None". So we didn't find the correct html template. 
For example, the URL is like "http://10.10.0.3/dashboard/project/stacks/stack/[outer stack id]/[resource_name]/None". 
Note: We can get the resource by "resource_name", and the resource_type in the resource is user customized, and is nested stack actually.


What's more,  if we add new resource_type(in fact, it's quite frequent in real project), we must update the code for "resource_urls", it's tedious and error prone.
Since the heat template already support define a new resource_type based on the customer's requirement, the dashboard should keep consistent with it. 
It's not a good behavior always to update this dictionary manually. Shall we do an enhancement on this point?
Please help to check it. Thanks very much.

** Affects: horizon
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1367542

Title:
  OpenStack Dashboard couldn't displayed nested stack very well

Status in OpenStack Dashboard (Horizon):
  New

Bug description:
  OpenStack Dashboard couldn't displayed nested stack very well.

  Example,
  Icehouse OpenStack Dasboard:

  In panel "Project" ---> "Orchestration" ---> "Stacks", when clicked tab "Resources", the "Stack Resources" could be displayed very well, continued to click this column's text of "Stack Resource" which is a link in the tables, the tab "Overview" could be displayed very well. Then, clicked this text of "Resource ID" which is a link in the tab "Overview", the displayed content in the html is: 
  "The page you were looking for doesn't exist

  You may have mistyped the address or the page may have moved."

  
  Root cause:

  In the template
  project/stacks/templates/stacks/_resource_overview.html, the
  "resource_url" need to be used.

      <dt>{% trans "Resource ID" %}</dt>
      <dd>
        <a href="{{ resource_url }}">
            {{ resource.physical_resource_id }}
        </a>
      </dd>

  the value of resource_url is setted in class "ResourceOverviewTab" in
  project/stacks/tabs.py, please see below code:

  class ResourceOverviewTab(tabs.Tab):
      name = _("Overview")
      slug = "resource_overview"
      template_name = "project/stacks/_resource_overview.html"

      def get_context_data(self, request):
          resource = self.tab_group.kwargs['resource']
          resource_url = mappings.resource_to_url(resource)
          return {
              "resource": resource,
              "resource_url": resource_url,
              "metadata": self.tab_group.kwargs['metadata']}

  
  the 'resource_urls' dictionary in project/stacks/mappings.py is out of date. It's not updated in Icehouse version, even earlier. some new concerns like Netron couldn't be found these.

  resource_urls = {
      "AWS::EC2::Instance": {
          'link': 'horizon:project:instances:detail'},
      "AWS::EC2::NetworkInterface": {
          'link': 'horizon:project:networks:ports:detail'},
      "AWS::EC2::RouteTable": {
          'link': 'horizon:project:routers:detail'},
      "AWS::EC2::Subnet": {
          'link': 'horizon:project:networks:subnets:detail'},
      "AWS::EC2::Volume": {
          'link': 'horizon:project:volumes:volumes:detail'},
      "AWS::EC2::VPC": {
          'link': 'horizon:project:networks:detail'},
      "AWS::S3::Bucket": {
          'link': 'horizon:project:containers:index'},
      "OS::Quantum::Net": {
          'link': 'horizon:project:networks:detail'},
      "OS::Quantum::Port": {
          'link': 'horizon:project:networks:ports:detail'},
      "OS::Quantum::Router": {
          'link': 'horizon:project:routers:detail'},
      "OS::Quantum::Subnet": {
          'link': 'horizon:project:networks:subnets:detail'},
      "OS::Swift::Container": {
          'link': 'horizon:project:containers:index',
          'format_pattern': '%s' + swift.FOLDER_DELIMITER},
  } 

  Since the "resource_type" could NOT match the type in "resource_urls", the value of "resource_url" in the template is "None". So we didn't find the correct html template. 
  For example, the URL is like "http://10.10.0.3/dashboard/project/stacks/stack/[outer stack id]/[resource_name]/None". 
  Note: We can get the resource by "resource_name", and the resource_type in the resource is user customized, and is nested stack actually.

  
  What's more,  if we add new resource_type(in fact, it's quite frequent in real project), we must update the code for "resource_urls", it's tedious and error prone.
  Since the heat template already support define a new resource_type based on the customer's requirement, the dashboard should keep consistent with it. 
  It's not a good behavior always to update this dictionary manually. Shall we do an enhancement on this point?
  Please help to check it. Thanks very much.

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1367542/+subscriptions


Follow ups

References