Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VolumeCreationTime variable added #130

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions caso/extract/openstack/cinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def _build_record(self, volume, extract_from, extract_to):
active_duration=active_duration,
measure_time=measure_time,
start_time=vol_created,
volume_creation=int(dateutil.parser.parse(vol_start).timestamp()),
capacity=volume.size,
user_dn=user,
)
Expand Down
2 changes: 2 additions & 0 deletions caso/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ class StorageRecord(_BaseRecord):
attached_to: typing.Optional[str]
measure_time: datetime.datetime
start_time: datetime.datetime
volume_creation: int

storage_type: typing.Optional[str] = "Block Storage (cinder)"

Expand Down Expand Up @@ -410,6 +411,7 @@ def map_fields(field: str) -> str:
"attached_duration": "AttachedDuration",
"cloud_type": "CloudType",
"compute_service": "CloudComputeService",
"volume_creation": "VolumeCreationTime",
}
return d.get(field, field)

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ python-neutronclient>=6.7.0 # Apache-2.0
keystoneauth1>=3.4.0 # Apache-2.0

stevedore
pydantic
pydantic==1.10.7