Code simplification suggestions

Bug #1893063 reported by Drew Freiberger
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
charm-iscsi-connector
Won't Fix
Wishlist
Unassigned

Bug Description

It may not be necessary to render_config upon charm install, as config-changed hook which also calls render_config is to follow immediately after an install hook. Suggest removing:

    self.framework.observe(self.on.install, self.render_config)

Setting the initiator_name in _iscsi_initiator() could be simplified to:

        initiator_name = initiators_dict.get(hostname, subprocess.getoutput('/sbin/iscsi-iname'))
        if hostname not in initiator_dict:
            logging.warning('The hostname was not found in the initiator dictionary!' +
                            'The random iqn %s will be used for %s',
                            initiator_name, hostname)

Functional test bundles could be set up with base.yaml and symlinks from focal.yaml and bionic.yaml along with moving "series: <distro>" to overlay templates, and charm_name variable should be lower-cased in the overlay templates. i.e. a suggested overlay template focal.yaml.j2:

series: focal
applications:
  {{ charm_name }}:
    charm: {{ CHARM_BUILD_DIR }}/{{ charm_name }}.charm

Changed in charm-iscsi-connector:
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
Eric Chen (eric-chen) wrote :

This charm is no longer being actively maintained.

Changed in charm-iscsi-connector:
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.