Skip to content

Commit

Permalink
Merge pull request #1 from ahmadgh9/dev
Browse files Browse the repository at this point in the history
merge dev into main
  • Loading branch information
ahmadgh9 authored Oct 10, 2023
2 parents b441656 + 031cfab commit 3918d32
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: pryorda/vmware_exporter
image: ahmadgh9/vmware_exporter
tags: latest ${{ github.sha }} ${{ github.event.release.tag_name }}
dockerfiles: |
./Dockerfile
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM python:3.7-alpine

LABEL MAINTAINER="Daniel Pryor <[email protected]>"
LABEL MAINTAINER="Ahmad Ghassemi <[email protected]>"
LABEL NAME=vmware_exporter

WORKDIR /opt/vmware_exporter/
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
prometheus-client==0.0.19
prometheus-client
pytz
pyvmomi>=6.5
twisted>=14.0.2
pyyaml>=5.1
service-identity
requests
2 changes: 1 addition & 1 deletion vmware_exporter/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = '0.18.4'
__version__ = '0.18.5'
__author__ = "Daniel Pryor"
__license__ = "BSD 3-Clause License"
10 changes: 6 additions & 4 deletions vmware_exporter/vmware_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ def session(self):
try:
yield threads.deferToThread(
self._session.post,
'https://{host}/rest/com/vmware/cis/session'.format(host=self.host)
'https://{host}/api/session'.format(host=self.host)
)
except Exception as e:
logging.error('Error creating vcenter API session ({})'.format(e))
Expand All @@ -468,7 +468,7 @@ def _tagIDs(self):
session = yield self.session
response = yield threads.deferToThread(
session.get,
'https://{host}/rest/com/vmware/cis/tagging/tag'.format(host=self.host)
'https://{host}/api/cis/tagging/tag'.format(host=self.host)
)
output = []
try:
Expand All @@ -491,7 +491,7 @@ def _attachedObjectsOnTags(self):
}
response = yield threads.deferToThread(
session.post,
'https://{host}/rest/com/vmware/cis/tagging/tag-association?~action=list-attached-objects-on-tags'
'https://{host}/api/cis/tagging/tag-association?action=list-attached-objects-on-tags'
.format(host=self.host),
json=jsonBody
)
Expand All @@ -518,7 +518,7 @@ def _tagNames(self):
for tagID in tagIDs:
response = yield threads.deferToThread(
session.get,
'https://{host}/rest/com/vmware/cis/tagging/tag/id:{tag_id}'.format(host=self.host, tag_id=tagID)
'https://{host}/api/cis/tagging/tag/id:{tag_id}'.format(host=self.host, tag_id=tagID)
)
tagObj = response.json().get('value', {})
if tagObj:
Expand Down Expand Up @@ -579,6 +579,8 @@ def connection(self):
pwd=self.password,
sslContext=context,
)
if vmware_connect is None:
raise error("could no connect to vcenter")
return vmware_connect

except vmodl.MethodFault as error:
Expand Down

0 comments on commit 3918d32

Please sign in to comment.