Skip to content

Commit a289994

Browse files
normalized line endings
1 parent 83915de commit a289994

File tree

21 files changed

+1210
-1210
lines changed

21 files changed

+1210
-1210
lines changed
Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
name: documentation
2-
3-
on:
4-
push:
5-
branches: [ master ]
6-
pull_request:
7-
branches: [ master ]
8-
jobs:
9-
build:
10-
runs-on: ubuntu-latest
11-
strategy:
12-
matrix:
13-
python-version: [3.8]
14-
15-
steps:
16-
- uses: actions/checkout@v2
17-
- name: Set up Python ${{ matrix.python-version }}
18-
uses: actions/setup-python@v1
19-
with:
20-
python-version: ${{ matrix.python-version }}
21-
- name: Install dependencies
22-
run: |
23-
python -m pip install --upgrade pip
24-
pip install -r tools/test-requirements.txt
25-
- name: Documentation Checks
26-
run: |
27-
python docCheck.py
1+
name: documentation
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
python-version: [3.8]
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Set up Python ${{ matrix.python-version }}
18+
uses: actions/setup-python@v1
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install -r tools/test-requirements.txt
25+
- name: Documentation Checks
26+
run: |
27+
python docCheck.py
Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
1-
# https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
2-
3-
name: Publish 📦 to TestPyPI
4-
5-
on:
6-
push:
7-
branches: [test-pypi ]
8-
9-
jobs:
10-
build-n-publish:
11-
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
12-
runs-on: ubuntu-latest
13-
steps:
14-
- uses: actions/checkout@master
15-
- name: Set up Python 3.8
16-
uses: actions/setup-python@v2
17-
with:
18-
python-version: 3.8
19-
- name: Install pypa/build
20-
run: >-
21-
python -m
22-
pip install
23-
build
24-
--user
25-
- name: Build a binary wheel and a source tarball
26-
run: >-
27-
python -m
28-
build
29-
--sdist
30-
--wheel
31-
--outdir dist/
32-
.
33-
- name: Publish 📦 to Test PyPI
34-
uses: pypa/gh-action-pypi-publish@master
35-
with:
36-
password: ${{ secrets.CGALLO_TEST_PYPI }}
1+
# https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
2+
3+
name: Publish 📦 to TestPyPI
4+
5+
on:
6+
push:
7+
branches: [test-pypi ]
8+
9+
jobs:
10+
build-n-publish:
11+
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@master
15+
- name: Set up Python 3.8
16+
uses: actions/setup-python@v2
17+
with:
18+
python-version: 3.8
19+
- name: Install pypa/build
20+
run: >-
21+
python -m
22+
pip install
23+
build
24+
--user
25+
- name: Build a binary wheel and a source tarball
26+
run: >-
27+
python -m
28+
build
29+
--sdist
30+
--wheel
31+
--outdir dist/
32+
.
33+
- name: Publish 📦 to Test PyPI
34+
uses: pypa/gh-action-pypi-publish@master
35+
with:
36+
password: ${{ secrets.CGALLO_TEST_PYPI }}
3737
repository_url: https://test.pypi.org/legacy/
Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,60 @@
1-
"""Lists all active billing items on this account. See https://cloud.ibm.com/billing/billing-items"""
2-
# :license: MIT, see LICENSE for more details.
3-
import click
4-
5-
from SoftLayer.CLI import environment
6-
from SoftLayer.CLI import formatting
7-
from SoftLayer.managers.account import AccountManager as AccountManager
8-
from SoftLayer import utils
9-
10-
11-
@click.command()
12-
@environment.pass_env
13-
def cli(env):
14-
"""Lists billing items with some other useful information.
15-
16-
Similiar to https://cloud.ibm.com/billing/billing-items
17-
"""
18-
19-
manager = AccountManager(env.client)
20-
items = manager.get_account_billing_items()
21-
table = item_table(items)
22-
23-
env.fout(table)
24-
25-
26-
def item_table(items):
27-
"""Formats a table for billing items"""
28-
table = formatting.Table([
29-
"Id",
30-
"Create Date",
31-
"Cost",
32-
"Category Code",
33-
"Ordered By",
34-
"Description",
35-
"Notes"
36-
], title="Billing Items")
37-
table.align['Description'] = 'l'
38-
table.align['Category Code'] = 'l'
39-
for item in items:
40-
description = item.get('description')
41-
fqdn = "{}.{}".format(item.get('hostName', ''), item.get('domainName', ''))
42-
if fqdn != ".":
43-
description = fqdn
44-
user = utils.lookup(item, 'orderItem', 'order', 'userRecord')
45-
ordered_by = "IBM"
46-
create_date = utils.clean_time(item.get('createDate'), in_format='%Y-%m-%d', out_format='%Y-%m-%d')
47-
if user:
48-
# ordered_by = "{} ({})".format(user.get('displayName'), utils.lookup(user, 'userStatus', 'name'))
49-
ordered_by = user.get('displayName')
50-
51-
table.add_row([
52-
item.get('id'),
53-
create_date,
54-
item.get('nextInvoiceTotalRecurringAmount'),
55-
item.get('categoryCode'),
56-
ordered_by,
57-
utils.trim_to(description, 50),
58-
utils.trim_to(item.get('notes', 'None'), 40),
59-
])
60-
return table
1+
"""Lists all active billing items on this account. See https://cloud.ibm.com/billing/billing-items"""
2+
# :license: MIT, see LICENSE for more details.
3+
import click
4+
5+
from SoftLayer.CLI import environment
6+
from SoftLayer.CLI import formatting
7+
from SoftLayer.managers.account import AccountManager as AccountManager
8+
from SoftLayer import utils
9+
10+
11+
@click.command()
12+
@environment.pass_env
13+
def cli(env):
14+
"""Lists billing items with some other useful information.
15+
16+
Similiar to https://cloud.ibm.com/billing/billing-items
17+
"""
18+
19+
manager = AccountManager(env.client)
20+
items = manager.get_account_billing_items()
21+
table = item_table(items)
22+
23+
env.fout(table)
24+
25+
26+
def item_table(items):
27+
"""Formats a table for billing items"""
28+
table = formatting.Table([
29+
"Id",
30+
"Create Date",
31+
"Cost",
32+
"Category Code",
33+
"Ordered By",
34+
"Description",
35+
"Notes"
36+
], title="Billing Items")
37+
table.align['Description'] = 'l'
38+
table.align['Category Code'] = 'l'
39+
for item in items:
40+
description = item.get('description')
41+
fqdn = "{}.{}".format(item.get('hostName', ''), item.get('domainName', ''))
42+
if fqdn != ".":
43+
description = fqdn
44+
user = utils.lookup(item, 'orderItem', 'order', 'userRecord')
45+
ordered_by = "IBM"
46+
create_date = utils.clean_time(item.get('createDate'), in_format='%Y-%m-%d', out_format='%Y-%m-%d')
47+
if user:
48+
# ordered_by = "{} ({})".format(user.get('displayName'), utils.lookup(user, 'userStatus', 'name'))
49+
ordered_by = user.get('displayName')
50+
51+
table.add_row([
52+
item.get('id'),
53+
create_date,
54+
item.get('nextInvoiceTotalRecurringAmount'),
55+
item.get('categoryCode'),
56+
ordered_by,
57+
utils.trim_to(description, 50),
58+
utils.trim_to(item.get('notes', 'None'), 40),
59+
])
60+
return table
Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
"""Cancels a billing item."""
2-
# :license: MIT, see LICENSE for more details.
3-
import click
4-
5-
from SoftLayer.CLI import environment
6-
from SoftLayer.managers.account import AccountManager as AccountManager
7-
8-
9-
@click.command()
10-
@click.argument('identifier')
11-
@environment.pass_env
12-
def cli(env, identifier):
13-
"""Cancels a billing item."""
14-
15-
manager = AccountManager(env.client)
16-
item = manager.cancel_item(identifier)
17-
18-
env.fout(item)
1+
"""Cancels a billing item."""
2+
# :license: MIT, see LICENSE for more details.
3+
import click
4+
5+
from SoftLayer.CLI import environment
6+
from SoftLayer.managers.account import AccountManager as AccountManager
7+
8+
9+
@click.command()
10+
@click.argument('identifier')
11+
@environment.pass_env
12+
def cli(env, identifier):
13+
"""Cancels a billing item."""
14+
15+
manager = AccountManager(env.client)
16+
item = manager.cancel_item(identifier)
17+
18+
env.fout(item)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"""Autoscale"""
1+
"""Autoscale"""

SoftLayer/CLI/tags/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"""Manage Tags"""
1+
"""Manage Tags"""

SoftLayer/CLI/tags/cleanup.py

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
"""Removes unused Tags"""
2-
# :license: MIT, see LICENSE for more details.
3-
4-
import click
5-
6-
from SoftLayer.CLI import environment
7-
from SoftLayer.managers.tags import TagManager
8-
9-
10-
@click.command()
11-
@click.option('--dry-run', '-d', is_flag=True, default=False,
12-
help="Don't delete, just show what will be deleted.")
13-
@environment.pass_env
14-
def cli(env, dry_run):
15-
"""Removes all empty tags."""
16-
17-
tag_manager = TagManager(env.client)
18-
empty_tags = tag_manager.get_unattached_tags()
19-
20-
for tag in empty_tags:
21-
if dry_run:
22-
click.secho("(Dry Run) Removing {}".format(tag.get('name')), fg='yellow')
23-
else:
24-
result = tag_manager.delete_tag(tag.get('name'))
25-
color = 'green' if result else 'red'
26-
click.secho("Removing {}".format(tag.get('name')), fg=color)
1+
"""Removes unused Tags"""
2+
# :license: MIT, see LICENSE for more details.
3+
4+
import click
5+
6+
from SoftLayer.CLI import environment
7+
from SoftLayer.managers.tags import TagManager
8+
9+
10+
@click.command()
11+
@click.option('--dry-run', '-d', is_flag=True, default=False,
12+
help="Don't delete, just show what will be deleted.")
13+
@environment.pass_env
14+
def cli(env, dry_run):
15+
"""Removes all empty tags."""
16+
17+
tag_manager = TagManager(env.client)
18+
empty_tags = tag_manager.get_unattached_tags()
19+
20+
for tag in empty_tags:
21+
if dry_run:
22+
click.secho("(Dry Run) Removing {}".format(tag.get('name')), fg='yellow')
23+
else:
24+
result = tag_manager.delete_tag(tag.get('name'))
25+
color = 'green' if result else 'red'
26+
click.secho("Removing {}".format(tag.get('name')), fg=color)

0 commit comments

Comments
 (0)