|
21 | 21 | from . import provisioner, tag, utils |
22 | 22 | from .annotationhelper import _get_annotations, _set_annotations |
23 | 23 | from .bundle import BundleHandler, get_charm_series |
| 24 | +from .charm import get_local_charm_metadata |
24 | 25 | from .charmhub import CharmHub |
25 | 26 | from .charmstore import CharmStore |
26 | 27 | from .client import client, connector |
@@ -1419,7 +1420,6 @@ async def deploy( |
1419 | 1420 | entity_url = str(entity_url) # allow for pathlib.Path objects |
1420 | 1421 | entity_path = Path(entity_url.replace('local:', '')) |
1421 | 1422 | bundle_path = entity_path / 'bundle.yaml' |
1422 | | - metadata_path = entity_path / 'metadata.yaml' |
1423 | 1423 |
|
1424 | 1424 | is_local = ( |
1425 | 1425 | entity_url.startswith('local:') or |
@@ -1470,12 +1470,8 @@ async def deploy( |
1470 | 1470 | entity_id, |
1471 | 1471 | entity=entity) |
1472 | 1472 | else: |
| 1473 | + metadata = get_local_charm_metadata(entity_path) |
1473 | 1474 | if not application_name: |
1474 | | - if str(entity_path).endswith('.charm'): |
1475 | | - with zipfile.ZipFile(entity_path, 'r') as charm_file: |
1476 | | - metadata = yaml.load(charm_file.read('metadata.yaml'), Loader=yaml.FullLoader) |
1477 | | - else: |
1478 | | - metadata = yaml.load(metadata_path.read_text(), Loader=yaml.FullLoader) |
1479 | 1475 | application_name = metadata['name'] |
1480 | 1476 | # We have a local charm dir that needs to be uploaded |
1481 | 1477 | charm_dir = os.path.abspath( |
|
0 commit comments