diff --git a/core/bundle/changes/changes_test.go b/core/bundle/changes/changes_test.go index c918679919e7..6f75fa3df349 100644 --- a/core/bundle/changes/changes_test.go +++ b/core/bundle/changes/changes_test.go @@ -3668,30 +3668,6 @@ func (s *changesSuite) TestLocalCharmWithExplicitBase(c *gc.C) { s.assertLocalBundleChangesWithDevices(c, charmDir, bundleContent, "ubuntu@16.04/stable") } -func (s *changesSuite) TestLocalCharmWithSeriesFromCharm(c *gc.C) { - charmDir := filepath.Join(c.MkDir(), "multiseries") - err := os.Mkdir(charmDir, 0700) - c.Assert(err, jc.ErrorIsNil) - bundleContent := fmt.Sprintf(` - applications: - django: - charm: %s - `, charmDir) - charmMeta := ` -name: multi-series -summary: That's a dummy charm with multi-series. -description: A dummy charm. -series: - - jammy - - focal - - bionic -`[1:] - err = os.WriteFile(filepath.Join(charmDir, "metadata.yaml"), []byte(charmMeta), 0644) - c.Assert(err, jc.ErrorIsNil) - s.assertLocalBundleChanges(c, charmDir, bundleContent, "ubuntu@22.04/stable") - s.assertLocalBundleChangesWithDevices(c, charmDir, bundleContent, "ubuntu@22.04/stable") -} - func (s *changesSuite) TestLocalCharmWithBaseFromBundle(c *gc.C) { charmDir := c.MkDir() bundleContent := fmt.Sprintf(` diff --git a/core/bundle/changes/handlers.go b/core/bundle/changes/handlers.go index 9b5c27d723f1..53bb83844869 100644 --- a/core/bundle/changes/handlers.go +++ b/core/bundle/changes/handlers.go @@ -14,7 +14,6 @@ import ( "github.com/juju/naturalsort" corebase "github.com/juju/juju/core/base" - corecharm "github.com/juju/juju/core/charm" ) type resolver struct { @@ -1288,20 +1287,7 @@ func getSeries(application *charm.ApplicationSpec, defaultSeries string) (string // Handle local charm paths. if charm.IsValidLocalCharmOrBundlePath(application.Charm) { - _, charmURL, err := corecharm.NewCharmAtPath(application.Charm, defaultSeries) - if corecharm.IsMissingSeriesError(err) { - // local charm path is valid but the charm doesn't declare a default series. - return defaultSeries, nil - } else if corecharm.IsUnsupportedSeriesError(err) { - // The bundle's default series is not supported by the charm, but we'll - // use it anyway. This is no different to the case above where application.Series - // is used without checking for potential charm incompatibility. - return defaultSeries, nil - } else if err != nil { - return "", errors.Trace(err) - } - // Return the default series from the local charm. - return charmURL.Series, nil + return defaultSeries, nil } // The following is safe because the bundle data is assumed to be already