Skip to content

Commit fdbccc8

Browse files
committed
chore: update license and exception
1 parent 60bc4fa commit fdbccc8

3 files changed

Lines changed: 53 additions & 5 deletions

File tree

samples/cloudrun/cloudrun/mysql/main.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
"""
2+
Copyright 2025 Google LLC
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
https://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
"""
16+
117
import os
218
import sqlalchemy
319
from flask import Flask
@@ -68,7 +84,7 @@ def password_auth_index():
6884
result = conn.execute(sqlalchemy.text("SELECT 1")).fetchall()
6985
return f"Database connection successful (password authentication), result: {result}"
7086
except Exception as e:
71-
return f"Error connecting to the database (password authentication): {e}", 500
87+
return f"Error connecting to the database (password authentication)", 500
7288

7389
@app.route("/iam")
7490
def iam_auth_index():
@@ -77,7 +93,7 @@ def iam_auth_index():
7793
result = conn.execute(sqlalchemy.text("SELECT 1")).fetchall()
7894
return f"Database connection successful (IAM authentication), result: {result}"
7995
except Exception as e:
80-
return f"Error connecting to the database (IAM authentication): {e}", 500
96+
return f"Error connecting to the database (IAM authentication)", 500
8197

8298
if __name__ == "__main__":
8399
app.run(host="0.0.0.0", port=int(os.environ.get("PORT", 8080)))

samples/cloudrun/cloudrun/postgres/main.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
"""
2+
Copyright 2025 Google LLC
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
https://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
"""
16+
117
import os
218
import sqlalchemy
319
from flask import Flask
@@ -68,7 +84,7 @@ def password_auth_index():
6884
result = conn.execute(sqlalchemy.text("SELECT 1")).fetchall()
6985
return f"Database connection successful (password authentication), result: {result}"
7086
except Exception as e:
71-
return f"Error connecting to the database (password authentication): {e}", 500
87+
return f"Error connecting to the database (password authentication)", 500
7288

7389
@app.route("/iam")
7490
def iam_auth_index():
@@ -77,7 +93,7 @@ def iam_auth_index():
7793
result = conn.execute(sqlalchemy.text("SELECT 1")).fetchall()
7894
return f"Database connection successful (IAM authentication), result: {result}"
7995
except Exception as e:
80-
return f"Error connecting to the database (IAM authentication): {e}", 500
96+
return f"Error connecting to the database (IAM authentication)", 500
8197

8298
if __name__ == "__main__":
8399
app.run(host="0.0.0.0", port=int(os.environ.get("PORT", 8080)))

samples/cloudrun/cloudrun/sqlserver/main.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
"""
2+
Copyright 2025 Google LLC
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
https://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
"""
16+
117
import os
218
import sqlalchemy
319
from flask import Flask
@@ -51,7 +67,7 @@ def index():
5167
result = conn.execute(sqlalchemy.text("SELECT 1")).fetchall()
5268
return f"Database connection successful, result: {result}"
5369
except Exception as e:
54-
return f"Error connecting to the database: {e}", 500
70+
return f"Error connecting to the database", 500
5571

5672
if __name__ == "__main__":
5773
app.run(host="0.0.0.0", port=int(os.environ.get("PORT", 8080)))

0 commit comments

Comments
 (0)