Skip to content

Commit

Permalink
Merge pull request #5 from Nike-Inc/fix-logging
Browse files Browse the repository at this point in the history
Summary: Fix BasicConfig logging error introduced by using a parameter supported in python 3.9+
  • Loading branch information
abdulhuq811 authored Jan 5, 2022
2 parents 062e613 + 4b51435 commit f33e500
Show file tree
Hide file tree
Showing 36 changed files with 52 additions and 42 deletions.
22 changes: 17 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Changelog

All notable changes to this project will be documented in this file.
`pterradactyl` adheres to [Semantic Versioning](http://semver.org/).

#### 1.x Releases
- `1.2.x` Releases - [1.2.7](#127)
- `1.2.x` Releases - [1.2.8](#128)
- `1.2.x` Releases - [1.2.7](#127) | [1.2.8](#128) | [1.2.10](#1210)

---
## Unreleased
Expand All @@ -20,12 +20,16 @@ All notable changes to this project will be documented in this file.
#### Fixed

---
## 1.2.10

## 1.2.7
#### Fixed
- Fixed backward compatibility issue caused due to unknown parameters in logging.BasicConfig introduced in python 3.9+.
- Fixed by [Mohamed Abdul Huq Ismail](https://github.com/aisma7_nike) in Pull Request [#5](https://github.com/Nike-Inc/pterradactyl/pull/5)

#### Added
- Added Pterradactyl documentation and init Pterradactyl version for OSS
- Added by [Marcin Zalewski](https://github.com/marcinjzalewski)
- Added new lines in examples and test configs.
- Added by [Mohamed Abdul Huq Ismail](https://github.com/aisma7_nike) in Pull Request [#5](https://github.com/Nike-Inc/pterradactyl/pull/5)


---
## 1.2.8
Expand All @@ -39,4 +43,12 @@ All notable changes to this project will be documented in this file.
- Added by [Marcin Zalewski](https://github.com/marcinjzalewski)
- Fix relative links to absolute urls in README.md
- Added by [Marcin Zalewski](https://github.com/marcinjzalewski)

---
## 1.2.7

#### Added
- Added Pterradactyl documentation and init Pterradactyl version for OSS
- Added by [Marcin Zalewski](https://github.com/marcinjzalewski)

---
2 changes: 1 addition & 1 deletion examples/complex/vars/account/common-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ sops:
- arn: arn:aws:kms:us-west-2:<account-id>:alias/<common-alias>
created_at:
enc:
aws_profile: ""
aws_profile: ""
2 changes: 1 addition & 1 deletion examples/complex/vars/account/projectb-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ sops:
- arn: arn:aws:kms:us-west-2:<account-id>:alias/<common-alias>
created_at:
enc:
aws_profile: ""
aws_profile: ""
2 changes: 1 addition & 1 deletion examples/complex/vars/account/projectb-prod.yaml.enc
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ sops:
- arn: arn:aws:kms:us-west-2:<account-id>:alias/<common-alias>
created_at:
enc:
aws_profile: ""
aws_profile: ""
2 changes: 1 addition & 1 deletion examples/complex/vars/account/projectc-test.yaml.enc
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ sops:
- arn: arn:aws:kms:us-west-2:<account-id>:alias/<common-alias>
created_at:
enc:
aws_profile: ""
aws_profile: ""
2 changes: 1 addition & 1 deletion examples/complex/vars/account_type/production.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
global:
dns_zone: '%{aws_account_alias}.<your_domain>.com'
dns_zone: '%{aws_account_alias}.<your_domain>.com'
2 changes: 1 addition & 1 deletion examples/complex/vars/account_type/test.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
global:
dns_zone: '%{aws_account_alias}.<your_domain>.com'
dns_zone: '%{aws_account_alias}.<your_domain>.com'
2 changes: 0 additions & 2 deletions examples/complex/vars/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,3 @@ module:
basic_bucket:
name: common-bucket
metadata: ${module.deployment.metadata}


Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ module:
encrypt_decrypt:
- self
- ${module.known_roles.this_account.power_role}
- ${module.known_roles.all_accounts.admin_role}
- ${module.known_roles.all_accounts.admin_role}
2 changes: 1 addition & 1 deletion examples/complex/vars/project/projecta/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ module:
stream_enabled: false
attributes:
- name: node_id
type: 'S'
type: 'S'
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module:
basic_bucket:
name: at-projecta-bucket
name: at-projecta-bucket
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ module:
name: vp-projectb-bucket
sqs:
name: vp-projectb-sqs
fifo_queue: false
fifo_queue: false
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module:
basic_bucket:
name: bt-projectb-bucket
name: bt-projectb-bucket
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ module:
hash_key: node_id
attributes:
- name: node_id
type: 'S'
type: 'S'
2 changes: 1 addition & 1 deletion examples/simple/vars/account/projecta-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ sops:
- arn: arn:aws:kms:us-west-2:<>:alias/<common-alias>
created_at:
enc:
aws_profile: ""
aws_profile: ""
2 changes: 1 addition & 1 deletion examples/simple/vars/account/projectb-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ sops:
- arn: arn:aws:kms:us-west-2:<>:alias/<common-alias>
created_at:
enc:
aws_profile: ""
aws_profile: ""
2 changes: 1 addition & 1 deletion examples/simple/vars/account_type/production.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
global:
dns_zone: '%{aws_account_alias}.<your_prod_domain>.com'
dns_zone: '%{aws_account_alias}.<your_prod_domain>.com'
2 changes: 1 addition & 1 deletion examples/simple/vars/account_type/test.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
global:
dns_zone: '%{aws_account_alias}.<your_test_domain>.com'
dns_zone: '%{aws_account_alias}.<your_test_domain>.com'
2 changes: 0 additions & 2 deletions examples/simple/vars/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,3 @@ manifest:
module:
basic_bucket:
name: common-bucket


Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ module:
encrypt_decrypt:
- self
- ${module.known_roles.this_account.power_role}
- ${module.known_roles.all_accounts.admin_role}
- ${module.known_roles.all_accounts.admin_role}
2 changes: 1 addition & 1 deletion examples/simple/vars/project/projecta/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ module:
stream_enabled: false
attributes:
- name: node_id
type: 'S'
type: 'S'
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ module:
dynamodb:
name: teama-prod-table
stream_enabled: true
stream_view_type: "NEW_AND_OLD_IMAGES"
stream_view_type: "NEW_AND_OLD_IMAGES"
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module:
basic_bucket:
name: at-projecta-bucket
name: at-projecta-bucket
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ module:
stream_enabled: true
attributes:
- name: node_id
type: 'S'
type: 'S'
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ module:
stream_enabled: false
attributes:
- name: node_id
type: 'M'
type: 'M'
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ module:
name: vp-projectb-bucket
sqs:
name: vp-projectb-sqs
fifo_queue: false
fifo_queue: false
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module:
basic_bucket:
name: bt-projectb-bucket
name: bt-projectb-bucket
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ module:
hash_key: node_id
attributes:
- name: node_id
type: 'S'
type: 'S'
4 changes: 3 additions & 1 deletion pterradactyl/terraform/terraform.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
from pterradactyl.util.download import download
from pterradactyl.util.filesystem import ensure_executable, ensure_directory, sync_local_tf_plugins, check_stderr

logging.basicConfig(level=logging.INFO, encoding='utf-8', format=None)
LOG_FORMAT = '[%(asctime)s] [%(levelname)s] [%(process)s] [%(name)s] ' \
'[%(filename)s/%(funcName)s:%(lineno)d]: %(message)s'
logging.basicConfig(level=logging.INFO, format=LOG_FORMAT)
log = logging.getLogger(__name__)


Expand Down
2 changes: 1 addition & 1 deletion pterradactyl/util/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ def check_stderr(std_err):

def get_json(path):
with open(path, "r") as stream:
return json.load(stream)
return json.load(stream)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pterradactyl"
version = "1.2.9"
version = "1.2.10"
description = "hiera-inspired terraform wrapper"
authors = ["Rob King <[email protected]>",
"Vincent Liu <[email protected]>"
Expand Down
2 changes: 1 addition & 1 deletion tests/pterradactyl/commands/test_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,4 @@ def test_execute_with_non_zero_returncode(self, mock_tf, mock_json, mock_get, mo
'-p', 'test_product', self.deployment,
'--command', 'test_command']))
mc.execute(parsed, ['apply'])
assert 'Access Denied from AWS' in self._caplog.text
assert 'Access Denied from AWS' in self._caplog.text
2 changes: 1 addition & 1 deletion tests/pterradactyl/util/test_resources/facts.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
"deploy_user": "testuser",
"account_prefix": "ct",
"state_prefix": "ct-integrationtests0-na-uswest2.tfstate.json"
}
}
2 changes: 1 addition & 1 deletion tests/resources/config/facts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ n: '0'
product: test
region: us-west-2
serving_region: na
state_prefix: ut-test0-na-uswest2.tfstate.json
state_prefix: ut-test0-na-uswest2.tfstate.json
2 changes: 1 addition & 1 deletion tests/resources/config/facts_invalid.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ n: '0'
product=test
region: us-west-2
serving_region: na
state_prefix: ut-test0-na-uswest2.tfstate.json
state_prefix: ut-test0-na-uswest2.tfstate.json
2 changes: 1 addition & 1 deletion tests/resources/config/pterra.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ pterradactyl:
module:
deployment:
product: '%{product}'
n: '%{n}'
n: '%{n}'

0 comments on commit f33e500

Please sign in to comment.