Skip to content

Commit b0aaf22

Browse files
committed
Updated date field in command - slcli cdn purge
1 parent 3c1080b commit b0aaf22

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

SoftLayer/CLI/cdn/purge.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Purge cached files from all edge nodes."""
22
# :license: MIT, see LICENSE for more details.
3+
import datetime
34

45
import click
56

@@ -28,8 +29,9 @@ def cli(env, unique_id, path):
2829
table = formatting.Table(['Date', 'Path', 'Saved', 'Status'])
2930

3031
for data in result:
32+
date = datetime.datetime.fromtimestamp(int(data['date']))
3133
table.add_row([
32-
data['date'],
34+
date,
3335
data['path'],
3436
data['saved'],
3537
data['status']

SoftLayer/managers/cdn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def purge_content(self, unique_id, path):
141141
:returns: A Container_Network_CdnMarketplace_Configuration_Cache_Purge array object
142142
"""
143143

144-
return self.cdn_purge.createPurge(unique_id, path)
144+
return self.cdn_purge.createPurge(unique_id, "/" + path)
145145

146146
def get_usage_metrics(self, unique_id, history=30, frequency="aggregate"):
147147
"""Retrieves the cdn usage metrics.

tests/managers/cdn_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def test_remove_origin(self):
109109
args=args)
110110

111111
def test_purge_content(self):
112-
self.cdn_client.purge_content("12345", "/example1")
112+
self.cdn_client.purge_content("12345", "example1")
113113

114114
args = ("12345",
115115
"/example1")

0 commit comments

Comments
 (0)